Whamcloud - gitweb
b=17187
[fs/lustre-release.git] / lnet / lnet / acceptor.c
index cadd36f..198b057 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -343,7 +343,7 @@ lnet_acceptor(void *arg)
        __u32          magic;
        __u32          peer_ip;
        int            peer_port;
-        int            secure = (int)((unsigned long)arg);
+        int            secure = (int)((long_ptr_t)arg);
 
        LASSERT (lnet_acceptor_state.pta_sock == NULL);
 
@@ -451,7 +451,7 @@ lnet_acceptor_start(void)
        if (lnet_count_acceptor_nis() == 0)  /* not required */
                return 0;
        
-       pid = cfs_kernel_thread(lnet_acceptor, (void *)secure, 0);
+       pid = cfs_kernel_thread(lnet_acceptor, (void *)(ulong_ptr_t)secure, 0);
        if (pid < 0) {
                CERROR("Can't start acceptor thread: %ld\n", pid);
                return -ESRCH;
@@ -695,7 +695,7 @@ lnet_acceptor(void *arg)
 
                 /* maybe we're waken up with libcfs_sock_abort_accept() */
                 if (lnet_acceptor_state.pta_shutdown) {
-                        close(newsock);
+                        libcfs_sock_release(newsock);
                         break;
                 }
 
@@ -721,10 +721,10 @@ lnet_acceptor(void *arg)
                 continue;
                 
           failed:
-                close(newsock);
+                libcfs_sock_release(newsock);
         }
         
-        close(lnet_acceptor_state.pta_sock);
+        libcfs_sock_release(lnet_acceptor_state.pta_sock);
         LCONSOLE(0,"Acceptor stopping\n");
 
         /* unblock lnet_acceptor_stop() */