summaryrefslogtreecommitdiffstats
path: root/src/database.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c5
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);