/**
* paraslash's 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
*
* \sa accept(2).
*/
{
int new_fd;
- new_fd = accept(fd, (struct sockaddr *) addr, &size);
- return new_fd == -1? -E_ACCEPT : new_fd;
+ do
+ new_fd = accept(fd, (struct sockaddr *) addr, &size);
+ while (new_fd < 0 && errno == EINTR);
+ return new_fd < 0? -E_ACCEPT : new_fd;
}
static int setserversockopts(int socket_fd)