From: Hallvard Furuseth Date: Mon, 6 Jul 2009 23:19:52 +0000 (+0000) Subject: Silence warning. Also avoids pointless umask(0) when umask already is 0. X-Git-Tag: ACLCHECK_0~449 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=461a2135fb980cb2c3608cea8a8df14162114f10;p=openldap Silence warning. Also avoids pointless umask(0) when umask already is 0. --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 8e4e853f2c..03085182fb 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -1478,7 +1478,7 @@ slap_open_listener( * create/unlink the socket; likely need exec perms to access * the socket (ITS#4709) */ { - mode_t old_umask; + mode_t old_umask = 0; if ( (*sal)->sa_family == AF_LOCAL ) { old_umask = umask( 0 ); @@ -1486,7 +1486,7 @@ slap_open_listener( #endif /* LDAP_PF_LOCAL */ rc = bind( s, *sal, addrlen ); #ifdef LDAP_PF_LOCAL - if ( (*sal)->sa_family == AF_LOCAL ) { + if ( old_umask != 0 ) { umask( old_umask ); } }