summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-22 14:24:19 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-22 14:24:19 +0300
commit0a7991f70dcfe9f8e05f6a4a4a59af21be878915 (patch)
tree9c6ef07e6f594b524bd1fc4746a103ab3d93d926 /src/cache.c
parent0dadc27ce1cfe84585a747d57e7d3bcafc1069eb (diff)
downloadapk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.tar.gz
apk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.tar.bz2
apk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.tar.xz
apk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.zip
various: misc fixes
- error codes for verification failure types - fix some fdb corruption on file migration - combine some dependency parsing code - fix versioned dependencies
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cache.c b/src/cache.c
index 7b5b7f1..ac2281e 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -9,9 +9,10 @@
* by the Free Software Foundation. See http://www.gnu.org/ for details.
*/
+#include <errno.h>
+#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
-#include <stdio.h>
#include "apk_defines.h"
#include "apk_applet.h"
@@ -140,7 +141,7 @@ static int cache_main(void *ctx, int argc, char **argv)
int r;
if (argc != 1)
- return -100;
+ return -EINVAL;
if (strcmp(argv[0], "sync") == 0)
actions = CACHE_CLEAN | CACHE_DOWNLOAD;
@@ -149,7 +150,7 @@ static int cache_main(void *ctx, int argc, char **argv)
else if (strcmp(argv[0], "download") == 0)
actions = CACHE_DOWNLOAD;
else
- return -100;
+ return -EINVAL;
r = apk_db_open(&db, apk_root,
APK_OPENF_NO_SCRIPTS | APK_OPENF_NO_INSTALLED);