diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-27 05:05:14 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-27 05:05:14 +0000 |
commit | 3eb388185b97920933a1bd17753866815e38539b (patch) | |
tree | db536e4df8c842c7ae44b0fbeb001cb68edc9a6c /socket.c | |
parent | 858fb9ebad77ceefc628344de26353d0a1936a9d (diff) | |
download | rsync-3eb388185b97920933a1bd17753866815e38539b.tar.gz |
a couple of changes to where the nonblocking settings are called.
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -54,6 +54,8 @@ int open_socket_out(char *host, int port) return -1; } + set_nonblocking(res); + return res; } @@ -110,9 +112,9 @@ determine if a file descriptor is in fact a socket ****************************************************************************/ int is_a_socket(int fd) { - int v,l; - l = sizeof(int); - return(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&v, &l) == 0); + int v,l; + l = sizeof(int); + return(getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&v, &l) == 0); } @@ -165,6 +167,8 @@ void start_accept_loop(int port, int (*fn)(int )) if (fork()==0) { close(s); + set_nonblocking(fd); + _exit(fn(fd)); } |