diff options
author | ed <ed@FreeBSD.org> | 2015-03-15 09:15:11 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2015-03-15 09:15:11 +0000 |
commit | 3cc419d83408cc3c19bc1a08007fda0bbb55ca39 (patch) | |
tree | c42156775c03416f3b0b75b5ed5df6ae2f3416b4 | |
parent | 56bfc41fb124e03f514503fa5aa62b566730b945 (diff) | |
download | FreeBSD-src-3cc419d83408cc3c19bc1a08007fda0bbb55ca39.zip FreeBSD-src-3cc419d83408cc3c19bc1a08007fda0bbb55ca39.tar.gz |
MFC r279016:
Make syslogd work in case shutdown() is POSIX-ly correct.
On POSIX conformant systems, shutdown() should return ENOTCONN when not
connected. We attempted to fix this once (kern/84761), but this change
got backed out because it 'breaks code' (r150155).
I just reapplied the patch and indeed, syslogd fails on startup. Make it
easier to re-enable this change in the future by paching up syslogd to
do the right thing.
Sponsored by: Nuxi
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index d7c281c..bc054b8 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -557,7 +557,8 @@ main(int argc, char *argv[]) if (finet) { if (SecureMode) { for (i = 0; i < *finet; i++) { - if (shutdown(finet[i+1], SHUT_RD) < 0) { + if (shutdown(finet[i+1], SHUT_RD) < 0 && + errno != ENOTCONN) { logerror("shutdown"); if (!Debug) die(0); |