diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-09 10:14:55 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-09 10:19:23 +0000 |
commit | f54b7bc3201726a7346b0920e561f5b68fa0af7d (patch) | |
tree | afdf58862888ed0d83cc722066a1cf85aa862a34 /src/database.c | |
parent | b852d670a985c4da11b012707acaa63b8abdfadc (diff) | |
download | apk-tools-f54b7bc3201726a7346b0920e561f5b68fa0af7d.tar.gz apk-tools-f54b7bc3201726a7346b0920e561f5b68fa0af7d.tar.bz2 apk-tools-f54b7bc3201726a7346b0920e561f5b68fa0af7d.tar.xz apk-tools-f54b7bc3201726a7346b0920e561f5b68fa0af7d.zip |
db: report error when create db in non-existing dir
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c index 676d086..9e6feb7 100644 --- a/src/database.c +++ b/src/database.c @@ -507,7 +507,10 @@ int apk_db_create(const char *root) int fd; fchdir(apk_cwd_fd); - chdir(root); + if (chdir(root) == -1) { + apk_error("%s: %s", root, strerror(errno)); + return -1; + } mkdir("tmp", 01777); mkdir("dev", 0755); |