Put update temp directory in with the others. Also, don't confuse returning
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Fri, 6 Nov 2009 06:17:44 +0000 (06:17 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Fri, 6 Nov 2009 06:17:44 +0000 (06:17 +0000)
error codes with number of download failures.

git-svn-id: http://opkg.googlecode.com/svn/trunk@273 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_cmd.c

index 8b18ec203efb85e39492e166447d54752194590c..83f4a16adb080a7f550cdabad2cea4b9e83557bf 100644 (file)
@@ -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;
      }