an error message. (Colin Walters)
* Added --no-whole-file and --no-blocking-io options (Dave Dykstra)
* Made the --write-batch and --read-batch options actually work
* Added --no-whole-file and --no-blocking-io options (Dave Dykstra)
* Made the --write-batch and --read-batch options actually work
- and added documentation in the man page (Jos Backus)
+ and added documentation in the man page (Jos Backus)
+
+ * If the daemon is unable to fork a child to accept a connection,
+ print an error message. (Colin Walters)
for each incoming connection */
while (1) {
fd_set fds;
for each incoming connection */
while (1) {
fd_set fds;
int fd;
struct sockaddr_storage addr;
socklen_t addrlen = sizeof addr;
int fd;
struct sockaddr_storage addr;
socklen_t addrlen = sizeof addr;
while (waitpid(-1, NULL, WNOHANG) > 0);
#endif
while (waitpid(-1, NULL, WNOHANG) > 0);
#endif
+ if ((pid = fork()) == 0) {
close(s);
/* open log file in child before possibly giving
up privileges */
log_open();
_exit(fn(fd));
close(s);
/* open log file in child before possibly giving
up privileges */
log_open();
_exit(fn(fd));
+ } else if (pid < 0) {
+ rprintf(FERROR,
+ RSYNC_NAME
+ ": could not create child server process: %s\n",
+ strerror(errno));
+ close(fd);
+ /* This might have happened because we're
+ * overloaded. Sleep briefly before trying to
+ * accept again. */
+ sleep(2);