Use closesocket() instead of close() for sockets on Windows
authorSam Hartman <hartmans@mit.edu>
Mon, 19 Sep 2011 00:59:24 +0000 (00:59 +0000)
committerSam Hartman <hartmans@mit.edu>
Mon, 19 Sep 2011 00:59:24 +0000 (00:59 +0000)
Signed-off-by: Alexey Melnikov <aamelnikov@gmail.com>
Signed-off-by: Sam Hartman <hartmans@debian.org>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25206 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gss-sample/gss-server.c

index 9b5cab29e521bf8d6bd04eb68e73c0a0c83effc3..c08b71497d00a3853c071f356ddba130bc343c3e 100644 (file)
@@ -320,12 +320,12 @@ create_socket(u_short port)
     (void) setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof(on));
     if (bind(s, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) {
         perror("binding socket");
-        (void) close(s);
+        (void) closesocket(s);
         return -1;
     }
     if (listen(s, 5) < 0) {
         perror("listening on socket");
-        (void) close(s);
+        (void) closesocket(s);
         return -1;
     }
     return s;