From bee9cba70cb678cdd927bc761766011085e3d20c Mon Sep 17 00:00:00 2001 From: sobomax Date: Sun, 4 Jul 2004 17:24:12 +0000 Subject: Nothing says that /var/log can't be not a directory but a symbolic link to a directory. Therefore, use stat(2) instead of lstat(2) to check if /var/log exists. MFC after: 7 days --- usr.sbin/newsyslog/newsyslog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c index df944e3..0a28c3f 100644 --- a/usr.sbin/newsyslog/newsyslog.c +++ b/usr.sbin/newsyslog/newsyslog.c @@ -2247,9 +2247,9 @@ createlog(const struct conf_entry *ent) slash = strrchr(tempfile, '/'); if (slash != NULL) { *slash = '\0'; - failed = lstat(tempfile, &st); + failed = stat(tempfile, &st); if (failed && errno != ENOENT) - err(1, "Error on lstat(%s)", tempfile); + err(1, "Error on stat(%s)", tempfile); if (failed) createdir(ent, tempfile); else if (!S_ISDIR(st.st_mode)) -- cgit v1.1