From 461a2135fb980cb2c3608cea8a8df14162114f10 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 6 Jul 2009 23:19:52 +0000 Subject: [PATCH] Silence warning. Also avoids pointless umask(0) when umask already is 0. --- servers/slapd/daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ); } } -- 2.39.5