From 376e31b20313890238b769958da6cd149d3ef70d Mon Sep 17 00:00:00 2001 From: graham.gower Date: Fri, 06 Nov 2009 01:17:44 -0500 Subject: 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 --- 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; } -- cgit v0.9.1