FBSD: always close the rx socket when shutting down
authorBen Kaduk <kaduk@mit.edu>
Sun, 4 Jul 2010 06:28:02 +0000 (02:28 -0400)
committerDerrick Brashear <shadow@dementia.org>
Sun, 4 Jul 2010 13:38:55 +0000 (06:38 -0700)
The soclose(rx_socket) call is needed in order to restart AFS.
(Otherwise sobind() fails with EADDRINUSE.)
While here, use the defined constant SHUT_RDWR instead of
hardcoding '2' for soshutdown's second argument.

Change-Id: Iba7cac3aec79764783628da28b12253d496a7680
Reviewed-on: http://gerrit.openafs.org/2331
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/rx/FBSD/rx_knet.c

index 77f2eab..3a1d456 100644 (file)
@@ -86,10 +86,8 @@ osi_StopListener(void)
     int haveGlock = ISAFS_GLOCK();
     if (haveGlock)
        AFS_GUNLOCK();
-    soshutdown(rx_socket, 2);
-#ifndef AFS_FBSD70_ENV
+    soshutdown(rx_socket, SHUT_RDWR);
     soclose(rx_socket);
-#endif
     p = pfind(rxk_ListenerPid);
     afs_warn("osi_StopListener: rxk_ListenerPid %lx\n", p);
     if (p)