X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=server.c;h=e94de736f81b9508739dbf0f4c38c180ede29fdb;hb=aa1b3b3b2398efd04a95168b9124f51f7d6912cc;hp=90f8cd535d67ac022284118e622e8f3528cf6099;hpb=8211954fc3390c0fa19cca788b03336a37aa9dc0;p=paraslash.git diff --git a/server.c b/server.c index 90f8cd53..e94de736 100644 --- a/server.c +++ b/server.c @@ -363,10 +363,16 @@ static void init_afs(void) afs_pid = fork(); if (afs_pid < 0) exit(EXIT_FAILURE); - if (!afs_pid) /* child (afs) */ + if (!afs_pid) { /* child (afs) */ + close(afs_server_socket[0]); afs_init(afs_socket_cookie, afs_server_socket[1]); + } close(afs_server_socket[1]); afs_socket = afs_server_socket[0]; + ret = mark_fd_nonblock(afs_socket); + if (ret < 0) + exit(EXIT_FAILURE); + add_close_on_fork_list(afs_socket); PARA_INFO_LOG("afs_socket: %d, afs_socket_cookie: %u\n", afs_socket, (unsigned) afs_socket_cookie); }