From cde8ab7f93670398400bef59219f9447e85da1af Mon Sep 17 00:00:00 2001 From: millert Date: Fri, 1 Jul 2016 15:00:48 +0000 Subject: [PATCH] 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@ --- usr.sbin/syslogd/syslogd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)) { -- 2.20.1