summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-21 09:03:10 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-21 09:03:10 +0000
commit02073e84d6963acb3d85e6c6ddf77ae59abc89e0 (patch)
tree7d87c1c7076eab82c00ad1abe6b7dbc705da8d42 /src
parent8a07b7fc727afa6568120dcf21328e277eb2d6c4 (diff)
downloadapk-tools-02073e84d6963acb3d85e6c6ddf77ae59abc89e0.tar.gz
apk-tools-02073e84d6963acb3d85e6c6ddf77ae59abc89e0.tar.bz2
apk-tools-02073e84d6963acb3d85e6c6ddf77ae59abc89e0.tar.xz
apk-tools-02073e84d6963acb3d85e6c6ddf77ae59abc89e0.zip
db: let apk_db_open() leave working dir as it was
Diffstat (limited to 'src')
-rw-r--r--src/database.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c
index 3e897d2..acc3acb 100644
--- a/src/database.c
+++ b/src/database.c
@@ -706,6 +706,7 @@ int apk_db_open(struct apk_database *db, const char *root, unsigned int flags)
}
}
+ fchdir(apk_cwd_fd);
return 0;
ret_errno:
@@ -713,6 +714,7 @@ ret_errno:
ret_r:
apk_error("%s: %s", msg, strerror(-r));
apk_db_close(db);
+ fchdir(apk_cwd_fd);
return r;
}