diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-11-15 23:24:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-11-15 23:24:25 +0000 |
commit | 8dee7079712ba89b4db50aca1a7684d991d24492 (patch) | |
tree | a19a12ad4b975ff30ca5e1894abdee49a6ec2061 /usr.sbin/cron/user.c | |
parent | a08be953a4c30133c652cf69b33fa3def5e620c4 (diff) |
Clean up the remaining uses of stderr and perror() and use warn/err
and/or syslog depending on whether stderr is hooked up at the time.
Also remove closelog() which is not needed since we are headed for exec.
OK guenther@
Diffstat (limited to 'usr.sbin/cron/user.c')
-rw-r--r-- | usr.sbin/cron/user.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/cron/user.c b/usr.sbin/cron/user.c index 2b896a32e3e..7e5d64a2040 100644 --- a/usr.sbin/cron/user.c +++ b/usr.sbin/cron/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.17 2015/11/09 01:12:27 millert Exp $ */ +/* $OpenBSD: user.c,v 1.18 2015/11/15 23:24:24 millert Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -22,9 +22,11 @@ #include <bitstring.h> /* for structs.h */ #include <ctype.h> #include <errno.h> +#include <pwd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <syslog.h> #include <time.h> /* for structs.h */ #include "macros.h" @@ -55,7 +57,7 @@ load_user(int crontab_fd, struct passwd *pw, const char *name) char **envp, **tenvp; if (!(file = fdopen(crontab_fd, "r"))) { - perror("fdopen on crontab_fd in load_user"); + syslog(LOG_ERR, "(%s) FDOPEN (%m)", pw->pw_name); return (NULL); } |