diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-04-04 17:24:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-04-04 17:24:51 +0000 |
commit | 4a3b8a7829c4bd197aff4c0cd80cc2e9ed848c5c (patch) | |
tree | 09dcc08230f0b1a68bd6e4cf8653a3de00ae1337 /usr.sbin/syslogd | |
parent | d0ebd0cc207709d8141e262402d39e9467d3f10c (diff) |
Return an error much earlier if recvmsg fails
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r-- | usr.sbin/syslogd/privsep_fdpass.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/privsep_fdpass.c b/usr.sbin/syslogd/privsep_fdpass.c index a9a2e6a1b7e..6984929fa9e 100644 --- a/usr.sbin/syslogd/privsep_fdpass.c +++ b/usr.sbin/syslogd/privsep_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep_fdpass.c,v 1.7 2008/03/24 16:11:05 deraadt Exp $ */ +/* $OpenBSD: privsep_fdpass.c,v 1.8 2012/04/04 17:24:50 deraadt Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -107,8 +107,10 @@ receive_fd(int sock) msg.msg_control = &cmsgbuf.buf; msg.msg_controllen = sizeof(cmsgbuf.buf); - if ((n = recvmsg(sock, &msg, 0)) == -1) + if ((n = recvmsg(sock, &msg, 0)) == -1) { warn("%s: recvmsg", "receive_fd"); + return -1; + } if (n != sizeof(int)) warnx("%s: recvmsg: expected received 1 got %ld", "receive_fd", (long)n); |