X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fidcache.c;h=2e46c1b047307af032e9654855c7fa13fbedb743;hb=04597d099c32b9b380b6c82eed97fb88ef467d2e;hp=b3de8bbaf1838b81f73712f9ce051a0ff420fa14;hpb=359c0a71713e606f440d40f55a43c77349df2aaa;p=gnulib.git diff --git a/lib/idcache.c b/lib/idcache.c index b3de8bbaf..2e46c1b04 100644 --- a/lib/idcache.c +++ b/lib/idcache.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H # include #endif @@ -27,9 +27,7 @@ #include #include -#if HAVE_UNISTD_H -# include -#endif +#include #include "xalloc.h" @@ -66,7 +64,7 @@ getuser (uid_t uid) return tail->name; pwent = getpwuid (uid); - tail = xmalloc (sizeof (struct userid)); + tail = xmalloc (sizeof *tail); tail->id.u = uid; tail->name = pwent ? xstrdup (pwent->pw_name) : NULL; @@ -108,7 +106,7 @@ getuidbyname (const char *user) } #endif - tail = xmalloc (sizeof (struct userid)); + tail = xmalloc (sizeof *tail); tail->name = xstrdup (user); /* Add to the head of the list, so most recently used is first. */ @@ -142,7 +140,7 @@ getgroup (gid_t gid) return tail->name; grent = getgrgid (gid); - tail = xmalloc (sizeof (struct userid)); + tail = xmalloc (sizeof *tail); tail->id.g = gid; tail->name = grent ? xstrdup (grent->gr_name) : NULL; @@ -184,7 +182,7 @@ getgidbyname (const char *group) } #endif - tail = xmalloc (sizeof (struct userid)); + tail = xmalloc (sizeof *tail); tail->name = xstrdup (group); /* Add to the head of the list, so most recently used is first. */