From 3f95a88ec7853bdb1de718e53e0b6db79a07f97c Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Tue, 4 Jul 1995 21:58:38 +0000 Subject: [PATCH] Oh fer cryin' out loud... While playing with the ypserv code on a different platform, I discovered the following: if you use ypcat (or anything that does a yp_all() for that matter) to dump out a map and then hit ^C before it finishes, ypserv gets hit with a SIGPIPE and dies. (The ypall() service is implemented using TCP.) Fix: ignore SIGPIPEs. --- gnu/usr.sbin/ypserv/yp_svc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnu/usr.sbin/ypserv/yp_svc.c b/gnu/usr.sbin/ypserv/yp_svc.c index b4ce7494cb2..8abb3499f3d 100644 --- a/gnu/usr.sbin/ypserv/yp_svc.c +++ b/gnu/usr.sbin/ypserv/yp_svc.c @@ -6,7 +6,7 @@ * And thus replied Lpd@NannyMUD: * Who cares? :-) /Peter Eriksson * - * $Id: yp_svc.c,v 1.2 1995/04/05 03:23:38 wpaul Exp $ + * $Id: yp_svc.c,v 1.3 1995/05/30 05:05:37 rgrimes Exp $ */ #include "system.h" @@ -23,6 +23,7 @@ #include #include #include +#include extern int errno; extern void Perror(); @@ -314,6 +315,12 @@ int main(int argc, char **argv) exit(1); } + /* + * Ignore SIGPIPEs. They can hurt us is someone does a ypcat + * and then hits CTRL-C before it terminales. + */ + signal(SIGPIPE, SIG_IGN); + (void) pmap_unset(YPPROG, YPVERS); if (sunos_4_kludge) (void) pmap_unset(YPPROG, 1);