From f54b7bc3201726a7346b0920e561f5b68fa0af7d Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 9 Jan 2009 10:14:55 +0000 Subject: db: report error when create db in non-existing dir --- src/database.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/database.c b/src/database.c index 676d086e28..9e6feb7fcd 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); -- cgit v1.2.3