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 /sbin | |
parent | d0ebd0cc207709d8141e262402d39e9467d3f10c (diff) |
Return an error much earlier if recvmsg fails
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pflogd/privsep_fdpass.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/pflogd/privsep_fdpass.c b/sbin/pflogd/privsep_fdpass.c index 0e6c3c4c1e8..ad618616ed9 100644 --- a/sbin/pflogd/privsep_fdpass.c +++ b/sbin/pflogd/privsep_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep_fdpass.c,v 1.5 2008/03/24 16:11:08 deraadt Exp $ */ +/* $OpenBSD: privsep_fdpass.c,v 1.6 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", __func__); + return -1; + } if (n != sizeof(int)) warnx("%s: recvmsg: expected received 1 got %ld", __func__, (long)n); |