]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Kill E_ACCEPT.
authorAndre Noll <maan@systemlinux.org>
Sun, 25 Nov 2007 11:25:08 +0000 (12:25 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 25 Nov 2007 11:25:08 +0000 (12:25 +0100)
error.h
net.c

diff --git a/error.h b/error.h
index 07821c221352e1124df509a7a8f6f011e04fe975..5932fdb366883ea46c166eed75cbcc911f335cef 100644 (file)
--- a/error.h
+++ b/error.h
@@ -175,7 +175,6 @@ extern const char **para_errlist[];
 #define NET_ERRORS \
        PARA_ERROR(SOCKET, "socket error"), \
        PARA_ERROR(CONNECT, "connect error"), \
-       PARA_ERROR(ACCEPT, "accept error"), \
        PARA_ERROR(SETSOCKOPT, "failed to set socket options"), \
        PARA_ERROR(BIND, "bind error"), \
        PARA_ERROR(NAME_TOO_LONG, "name too long for struct sockaddr_un"), \
diff --git a/net.c b/net.c
index f01cf5830e84eafa5e88890f5f8d9a68de4d0316..733f738031ed337e80a9e956e9bee6b23a3e8695 100644 (file)
--- a/net.c
+++ b/net.c
@@ -294,15 +294,15 @@ int get_stream_socket(int domain)
 }
 
 /**
- * paraslash's wrapper around the accept system call
+ * Wrapper around the accept system call.
  *
- * \param fd the listening socket
- * \param addr structure which is filled in with the address of the peer socket
- * \param size should contain the size of the structure pointed to by \a addr
+ * \param fd The listening socket.
+ * \param addr Structure which is filled in with the address of the peer socket.
+ * \param size Should contain the size of the structure pointed to by \a addr.
  *
  * Accept incoming connections on \a addr. Retry if interrupted.
  *
- * \return The new file descriptor on success, \a -E_ACCEPT on errors.
+ * \return The new file descriptor on success, negative on errors.
  *
  * \sa accept(2).
  */
@@ -313,7 +313,7 @@ int para_accept(int fd, void *addr, socklen_t size)
        do
                new_fd = accept(fd, (struct sockaddr *) addr, &size);
        while (new_fd < 0 && errno == EINTR);
-       return new_fd < 0? -E_ACCEPT : new_fd;
+       return new_fd < 0? -ERRNO_TO_PARA_ERROR(errno) : new_fd;
 }
 
 static int setserversockopts(int socket_fd)