summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
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);