From: millert Date: Fri, 1 Jul 2016 15:00:48 +0000 (+0000) Subject: Include errno string in log message when we fail to open a file. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cde8ab7f93670398400bef59219f9447e85da1af;p=openbsd Include errno string in log message when we fail to open a file. The privileged process sends the errno value back when it cannot open a file. OK gilles@ --- diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index da917502a27..e916ef12e1c 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.205 2016/04/02 19:55:10 krw Exp $ */ +/* $OpenBSD: syslogd.c,v 1.206 2016/07/01 15:00:48 millert Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -1897,7 +1897,7 @@ fprintlog(struct filed *f, int flags, char *msg) retryonce = 1; if (f->f_file < 0) { f->f_type = F_UNUSED; - logerrorx(f->f_un.f_fname); + logerror(f->f_un.f_fname); } else goto again; } else if ((e == EPIPE || e == EBADF) && @@ -1906,7 +1906,7 @@ fprintlog(struct filed *f, int flags, char *msg) retryonce = 1; if (f->f_file < 0) { f->f_type = F_UNUSED; - logerrorx(f->f_un.f_fname); + logerror(f->f_un.f_fname); } else goto again; } else { @@ -1959,7 +1959,7 @@ wallmsg(struct filed *f, struct iovec *iov) if (reenter++) return; if ((uf = priv_open_utmp()) == NULL) { - logerrorx(_PATH_UTMP); + logerror(_PATH_UTMP); reenter = 0; return; } @@ -2638,7 +2638,7 @@ cfline(char *line, char *progblock, char *hostblock) f->f_file = priv_open_log(p); if (f->f_file < 0) { f->f_type = F_UNUSED; - logerrorx(p); + logerror(p); break; } if (isatty(f->f_file)) {