diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-11-03 04:16:37 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-11-03 04:16:37 +0000 |
commit | 56e1917121f1f9f4e30dd1902fa3ed514b142aba (patch) | |
tree | 3a459c9a0c6c9b71fad6fbb745d6d0e1f4bd54b4 /usr.sbin/cron/client.c | |
parent | d629f847bee270290dc740c61848037bd6673d4a (diff) |
Use send(MSG_NOSIGNAL) instead of mucking with the disposition of SIGPIPE
ok millert@
Diffstat (limited to 'usr.sbin/cron/client.c')
-rw-r--r-- | usr.sbin/cron/client.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/cron/client.c b/usr.sbin/cron/client.c index b9e0cd9554d..2cf65abd00a 100644 --- a/usr.sbin/cron/client.c +++ b/usr.sbin/cron/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.1 2015/10/31 12:19:41 millert Exp $ */ +/* $OpenBSD: client.c,v 1.2 2015/11/03 04:16:36 guenther Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -89,14 +89,12 @@ poke_daemon(const char *spool_dir, unsigned char cookie) return; } s_un.sun_family = AF_UNIX; - (void) signal(SIGPIPE, SIG_IGN); if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) >= 0 && connect(sock, (struct sockaddr *)&s_un, sizeof(s_un)) == 0) - write(sock, &cookie, 1); + send(sock, &cookie, 1, MSG_NOSIGNAL); else fprintf(stderr, "%s: warning, cron does not appear to be " "running.\n", ProgramName); if (sock >= 0) close(sock); - (void) signal(SIGPIPE, SIG_DFL); } |