]> git.sur5r.net Git - openldap/commitdiff
ITS#6676 only close/unlink socket in Server mode
authorHoward Chu <hyc@openldap.org>
Sat, 16 Oct 2010 12:14:49 +0000 (12:14 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 16 Oct 2010 12:14:49 +0000 (12:14 +0000)
contrib/slapd-modules/nssov/nssov.c

index 84e05b2e6fdd45a74c7893d5327d96ea1eda747d..fa054792706d23f5b2cb3216b2ec37e2f9f41685 100644 (file)
@@ -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);
+               }
        }
 }