From 6c07c5b094bd89019872b7fd37d3f43d83041a53 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 19 Feb 2015 18:56:39 +0000 Subject: 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. MFC after: 3 weeks Sponsored by: Nuxi --- usr.sbin/syslogd/syslogd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.sbin/syslogd') 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); -- cgit v1.1