diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 2405748a5ace..b2693874dd3e 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1048,12 +1048,29 @@ fprintlog(struct filed *f, int flags, const char *msg) if (lsent == l && !send_to_all) break; } + dprintf("lsent/l: %d/%d\n", lsent, l); if (lsent != l) { int e = errno; - (void)close(f->f_file); - errno = e; - f->f_type = F_UNUSED; logerror("sendto"); + errno = e; + switch (errno) { + case EHOSTUNREACH: + case EHOSTDOWN: + break; + /* case EBADF: */ + /* case EACCES: */ + /* case ENOTSOCK: */ + /* case EFAULT: */ + /* case EMSGSIZE: */ + /* case EAGAIN: */ + /* case ENOBUFS: */ + /* case ECONNREFUSED: */ + default: + dprintf("removing entry\n", e); + (void)close(f->f_file); + f->f_type = F_UNUSED; + break; + } } } break;