[xiph-cvs] cvs commit: net sock.c

Jack Moffitt jack at xiph.org
Fri Mar 22 13:09:36 PST 2002



jack        02/03/22 13:09:36

  Modified:    .        sock.c
  Log:
  Add error == 0 to recoverable error numbers.  Patch from Ricardo Galli.
  Minor style fixes.

Revision  Changes    Path
1.3       +6 -5      net/sock.c

Index: sock.c
===================================================================
RCS file: /usr/local/cvsroot/net/sock.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sock.c	2001/10/20 05:57:28	1.2
+++ sock.c	2002/03/22 21:09:36	1.3
@@ -118,7 +118,7 @@
 */
 int sock_recoverable(int error)
 {
-	return (error == EAGAIN || error == EINTR || error == EINPROGRESS || error == EWOULDBLOCK);
+	return (error == 0 || error == EAGAIN || error == EINTR || error == EINPROGRESS || error == EWOULDBLOCK);
 }
 
 /* sock_valid_socket
@@ -433,7 +433,7 @@
         /* defaults */
         memset(&sa, 0, sizeof(sa));
         sa_family = AF_INET;
-	sa_len = sizeof (struct sockaddr_in);
+	sa_len = sizeof(struct sockaddr_in);
 
         /* set the interface to bind to if specified */
         if (sinterface != NULL) {
@@ -449,12 +449,13 @@
                         sa_len = sizeof (struct sockaddr_in6);
                         ((struct sockaddr_in6*)&sa)->sin6_family = AF_INET6;
                         ((struct sockaddr_in6*)&sa)->sin6_port = htons(port);
-		} else
+		} else {
                         return SOCK_ERROR;
+		}
 #else
-		if (!inet_aton(ip, &sa.sin_addr))
+		if (!inet_aton(ip, &sa.sin_addr)) {
                         return SOCK_ERROR;
-		else {
+		} else {
                         sa.sin_family = AF_INET;
                         sa.sin_port = htons(port);
                 }

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list