summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-06 01:17:44 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-06 01:17:44 (EST)
commit376e31b20313890238b769958da6cd149d3ef70d (patch)
tree367ac18de0ac70ec705e4721e2674635ef55854e /libopkg
parentfe04977d73bf6e1dea5f02317cb3e6b23df36c59 (diff)
Put update temp directory in with the others. Also, don't confuse returning
error codes with number of download failures. git-svn-id: http://opkg.googlecode.com/svn/trunk@273 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/opkg_cmd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index 8b18ec2..83f4a16 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -180,7 +180,7 @@ static int opkg_update_cmd(opkg_conf_t *conf, int argc, char **argv)
"%s: ERROR: %s exists, but is not a directory\n",
__FUNCTION__, lists_dir);
free(lists_dir);
- return EINVAL;
+ return -1;
}
err = file_mkdir_hier(lists_dir, 0755);
if (err) {
@@ -188,18 +188,16 @@ static int opkg_update_cmd(opkg_conf_t *conf, int argc, char **argv)
"%s: ERROR: failed to make directory %s: %s\n",
__FUNCTION__, lists_dir, strerror(errno));
free(lists_dir);
- return EINVAL;
+ return -1;
}
}
failures = 0;
-
- tmp = xstrdup("/tmp/opkg.XXXXXX");
-
+ sprintf_alloc(&tmp, "%s/update-XXXXXX", conf->tmp_dir);
if (mkdtemp (tmp) == NULL) {
perror ("mkdtemp");
- failures++;
+ return -1;
}