From: thib Date: Sun, 11 May 2008 11:08:23 +0000 (+0000) Subject: do not test errno after getgrnam() (it shouldn't be tested and it was created problem... X-Git-Tag: ver3_0_5~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=990e9c7b378db6c3bb12e99306bc893d5f6713f5;p=fcron do not test errno after getgrnam() (it shouldn't be tested and it was created problems on some non-linux systems) --- diff --git a/subs.c b/subs.c index 219f867..395c097 100644 --- a/subs.c +++ b/subs.c @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: subs.c,v 1.28 2007-06-03 17:52:53 thib Exp $ */ + /* $Id: subs.c,v 1.29 2008-05-11 11:08:23 thib Exp $ */ #include "global.h" #include "subs.h" @@ -65,11 +65,11 @@ gid_t get_group_gid_safe(char *groupname) /* get the gid of group groupname, and die on error */ { - struct group *grp; + struct group *grp = NULL; errno = 0; grp = getgrnam(groupname); - if ( errno != 0 || grp == NULL ) { + if ( grp == NULL ) { die_e("Unable to get the gid of group %s", groupname); }