opkg_svn: fixed broken uname gname cache (this significantly speeds up)
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-devtools / opkg / opkg / unarchive-fixed-uname-gname-cache.patch
diff --git a/meta-openvuplus/recipes-devtools/opkg/opkg/unarchive-fixed-uname-gname-cache.patch b/meta-openvuplus/recipes-devtools/opkg/opkg/unarchive-fixed-uname-gname-cache.patch
new file mode 100644 (file)
index 0000000..3a13a5b
--- /dev/null
@@ -0,0 +1,33 @@
+diff -Naur trunk.org/libbb/unarchive.c trunk/libbb/unarchive.c
+--- trunk.org/libbb/unarchive.c        2012-08-30 13:45:44.000000000 +0200
++++ trunk/libbb/unarchive.c    2012-09-13 11:50:57.822754393 +0200
+@@ -446,12 +446,12 @@
+       struct passwd *passwd;
+       if (!uname)
+               return FALSE;
+-      if (!uname_cache[0] && strcmp(uname_cache, uname) == 0)
++      if (!strcmp(uname_cache, uname))
+               return TRUE;
+       passwd = getpwnam(uname);
+       if (passwd) {
+               uid_cache = passwd->pw_uid;
+-              strncpy(uname, uname_cache, 32);
++              strncpy(uname_cache, uname, 32);
+               return TRUE;
+       }
+       return FALSE;
+@@ -464,12 +464,12 @@
+       struct group *group;
+       if (!gname)
+               return FALSE;
+-      if (!gname_cache[0] && strcmp(gname_cache, gname) == 0)
++      if (!strcmp(gname_cache, gname))
+               return TRUE;
+       group = getgrnam(gname);
+       if (group) {
+               gid_cache = group->gr_gid;
+-              strncpy(gname, gname_cache, 32);
++              strncpy(gname_cache, gname, 32);
+               return TRUE;
+       }
+       return FALSE;