#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"), \
}
/**
- * 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).
*/
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)