From: Howard Chu Date: Sat, 16 Oct 2010 12:14:49 +0000 (+0000) Subject: ITS#6676 only close/unlink socket in Server mode X-Git-Tag: MIGRATION_CVS2GIT~455 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7600b22f3c0ba09dedc6f2e24ee2447871c8b127;p=openldap ITS#6676 only close/unlink socket in Server mode --- diff --git a/contrib/slapd-modules/nssov/nssov.c b/contrib/slapd-modules/nssov/nssov.c index 84e05b2e6f..fa05479270 100644 --- a/contrib/slapd-modules/nssov/nssov.c +++ b/contrib/slapd-modules/nssov/nssov.c @@ -881,18 +881,20 @@ nssov_db_close( slap_overinst *on = (slap_overinst *)be->bd_info; nssov_info *ni = on->on_bi.bi_private; - /* close socket if it's still in use */ - if (ni->ni_socket >= 0); - { - if (close(ni->ni_socket)) - Debug( LDAP_DEBUG_ANY,"problem closing server socket (ignored): %s",strerror(errno),0,0); - ni->ni_socket = -1; - } - /* remove existing named socket */ - if (unlink(NSLCD_SOCKET)<0) - { - Debug( LDAP_DEBUG_TRACE,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", - strerror(errno),0,0); + if ( slapMode & SLAP_SERVER_MODE ) { + /* close socket if it's still in use */ + if (ni->ni_socket >= 0); + { + if (close(ni->ni_socket)) + Debug( LDAP_DEBUG_ANY,"problem closing server socket (ignored): %s",strerror(errno),0,0); + ni->ni_socket = -1; + } + /* remove existing named socket */ + if (unlink(NSLCD_SOCKET)<0) + { + Debug( LDAP_DEBUG_TRACE,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", + strerror(errno),0,0); + } } }