From: Thibault Godouet 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: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c74f93245af8e362d24845b3d326836fd1abcf8e;p=thirdparty%2Ffcron.git 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); }