devnodes-minimal: new recipe to create /dev/console and /dev/null
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0010-fixed-broken-uname-gname-cache-this-significantly-sp.patch
1 From 5532fcd48299f77afb9df25e1a530fb16b6ddb80 Mon Sep 17 00:00:00 2001
2 From: Andreas Monzner <andreas.monzner@dream-property.net>
3 Date: Tue, 5 Mar 2013 22:20:20 +0100
4 Subject: [PATCH 10/17] fixed broken uname gname cache (this significantly
5  speeds up)
6
7 ---
8  libbb/unarchive.c | 8 ++++----
9  1 file changed, 4 insertions(+), 4 deletions(-)
10
11 diff --git a/libbb/unarchive.c b/libbb/unarchive.c
12 index d583767..89447d4 100644
13 --- a/libbb/unarchive.c
14 +++ b/libbb/unarchive.c
15 @@ -446,12 +446,12 @@ static bool update_unamecache(char *uname) {
16         struct passwd *passwd;
17         if (!uname)
18                 return FALSE;
19 -       if (!uname_cache[0] && strcmp(uname_cache, uname) == 0)
20 +       if (!strcmp(uname_cache, uname))
21                 return TRUE;
22         passwd = getpwnam(uname);
23         if (passwd) {
24                 uid_cache = passwd->pw_uid;
25 -               strncpy(uname, uname_cache, 32);
26 +               strncpy(uname_cache, uname, 32);
27                 return TRUE;
28         }
29         return FALSE;
30 @@ -464,12 +464,12 @@ static bool update_gnamecache(char *gname) {
31         struct group *group;
32         if (!gname)
33                 return FALSE;
34 -       if (!gname_cache[0] && strcmp(gname_cache, gname) == 0)
35 +       if (!strcmp(gname_cache, gname))
36                 return TRUE;
37         group = getgrnam(gname);
38         if (group) {
39                 gid_cache = group->gr_gid;
40 -               strncpy(gname, gname_cache, 32);
41 +               strncpy(gname_cache, gname, 32);
42                 return TRUE;
43         }
44         return FALSE;
45 -- 
46 1.8.1.2
47