db: report error when create db in non-existing dir

cute-signatures
Natanael Copa 2009-01-09 10:14:55 +00:00
parent b852d670a9
commit f54b7bc320
1 changed files with 4 additions and 1 deletions

View File

@ -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);