]> git.sur5r.net Git - openldap/commitdiff
Silence warning. Also avoids pointless umask(0) when umask already is 0.
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 6 Jul 2009 23:19:52 +0000 (23:19 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 6 Jul 2009 23:19:52 +0000 (23:19 +0000)
servers/slapd/daemon.c

index 8e4e853f2c2d3c977c8a2440f93ca440c7373f0b..03085182fb6aa6d3dd7ea8e4079487c8fe07ac2f 100644 (file)
@@ -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 );
                        }
                }