X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fstatd%2Fstatd.c;h=48362c0104d332c4f4aa7db4f131b07794d48dc6;hb=72913e3a0498e2099800de53871b696c72feda1b;hp=f666bcd4cba4e1e61247e715d293e06fc281fd88;hpb=af93e0306d87bba3f703386fd6390e9bf8e76816;p=nfs-utils.git diff --git a/utils/statd/statd.c b/utils/statd/statd.c index f666bcd..48362c0 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -111,7 +111,8 @@ killer (int sig) static void sigusr (int sig) { - dprintf (N_DEBUG, "Caught signal %d, re-reading notify list.", sig); + dprintf (N_DEBUG, "Caught signal %d, re-notifying (state %d).", sig, + MY_STATE); re_notify = 1; } @@ -422,6 +423,11 @@ int main (int argc, char **argv) signal(SIGUSR1, sigusr); /* WARNING: the following works on Linux and SysV, but not BSD! */ signal(SIGCHLD, SIG_IGN); + /* + * Ignore SIGPIPE to avoid statd dying when peers close their + * TCP connection while we're trying to reply to them. + */ + signal(SIGPIPE, SIG_IGN); /* initialize out_port */ statd_get_socket(out_port);