opkg_nogpg-nocurl: update fix_tmpdirs patch, bump PR
authorMike Westerhof <mwester@dls.net>
Sun, 11 Jan 2009 00:33:53 +0000 (18:33 -0600)
committerMike Westerhof <mwester@dls.net>
Sun, 11 Jan 2009 00:33:53 +0000 (18:33 -0600)
packages/opkg/files/opkg_wget_nogpg_03_fix_tmpdirs.patch
packages/opkg/opkg-nogpg-nocurl_svn.bb

index e619562..68c2b93 100644 (file)
@@ -5,7 +5,8 @@
 # files it creates further reduce the amount of available memory.
 #
 # Mike Westerhof, Dec 2008
-
+#
+# Patch updated Jan 2009
 --- orig/libopkg/opkg.c        2008-12-20 15:07:04.000000000 -0600
 +++ opkg/libopkg/opkg.c        2008-12-21 21:41:07.000000000 -0600
 @@ -773,15 +773,17 @@
@@ -55,7 +56,7 @@
 +//     tmp = tmpfile();
 +     sprintf_alloc(&tmp_fname, "%s-XXXXXX", opkg_conf_tmp_name);
 +     tmp_f = mkstemp(tmp_fname);
-+     if (tmp_f == 0) {
++     if (tmp_f < 0) {
 +             perror("mkstemp()");
 +             free(tmp_fname);
 +             return errno;
@@ -63,7 +64,7 @@
 +     /* printf("%s: Using tmp_fname %s\n", __FUNCTION__, tmp_fname); */
 +     unlink(tmp_fname);
 +     free(tmp_fname);
-+     tmp = fdopen(tmp_f, "w");
++     tmp = fdopen(tmp_f, "w+");
 +
       if (pkg->installed_files) {
          str_list_elt_t *elt;
 +//     control_file = tmpfile();
 +     sprintf_alloc(&tmp_fname, "%s-XXXXXX", opkg_conf_tmp_name);
 +     tmp_f = mkstemp(tmp_fname);
-+     if (tmp_f == 0) {
++     if (tmp_f < 0) {
 +           perror("mkstemp()");
 +           free(tmp_fname);
 +           return errno;
 +     /* printf("%s: Using tmp_fname %s\n", __FUNCTION__, tmp_fname); */
 +     unlink(tmp_fname);
 +     free(tmp_fname);
-+     control_file = fdopen(tmp_f, "w");
++     control_file = fdopen(tmp_f, "w+");
 +
       err = pkg_extract_control_file_to_stream(pkg, control_file);
       if (err) { return err; }
 +//      list_file = tmpfile();
 +        sprintf_alloc(&tmp_fname, "%s-XXXXXX", opkg_conf_tmp_name);
 +        tmp_f = mkstemp(tmp_fname);
-+        if (tmp_f == 0) {
++        if (tmp_f < 0) {
 +                perror("mkstemp()");
 +                free(tmp_fname);
 +                return pkg->installed_files;
 +        /* printf("%s: Using tmp_fname %s\n", __FUNCTION__, tmp_fname); */
 +        unlink(tmp_fname);
 +        free(tmp_fname);
-+        list_file = fdopen(tmp_f, "w");
++        list_file = fdopen(tmp_f, "w+");
 +
          err = pkg_extract_data_file_names_to_stream(pkg, list_file);
          if (err) {
index d385dc8..4daa58f 100644 (file)
@@ -10,7 +10,7 @@ SRC_URI += " \
            file://opkg_wget_nogpg_02_use_vfork_system.patch;patch=1 \
            file://opkg_wget_nogpg_03_fix_tmpdirs.patch;patch=1 \
           "
-PR = "r2"
+PR = "r3"
 
 SRCREV = "${SRCREV_pn-opkg}"