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
This commit is contained in:
Ed Schouten 2015-02-19 18:56:39 +00:00
parent 6740ed378b
commit 0f0d5f6e45
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279016

View File

@ -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);