diff options
author | sobomax <sobomax@FreeBSD.org> | 2004-07-04 17:24:12 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2004-07-04 17:24:12 +0000 |
commit | bee9cba70cb678cdd927bc761766011085e3d20c (patch) | |
tree | 21eeb0f379e3675e0f981c044c5143ade90bc99e /usr.sbin/newsyslog | |
parent | 6190bf9bc443171837211153171aa7106a2f1462 (diff) | |
download | FreeBSD-src-bee9cba70cb678cdd927bc761766011085e3d20c.zip FreeBSD-src-bee9cba70cb678cdd927bc761766011085e3d20c.tar.gz |
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
Diffstat (limited to 'usr.sbin/newsyslog')
-rw-r--r-- | usr.sbin/newsyslog/newsyslog.c | 4 |
1 files 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)) |