=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/logging.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/sudo/Attic/logging.c 2003/03/28 18:55:30 1.11 --- src/usr.bin/sudo/Attic/logging.c 2003/04/03 19:15:34 1.12 *************** *** 57,62 **** --- 57,67 ---- #ifdef HAVE_UNISTD_H # include #endif /* HAVE_UNISTD_H */ + #ifdef HAVE_ERR_H + # include + #else + # include "emul/err.h" + #endif /* HAVE_ERR_H */ #include #include #include *************** *** 65,71 **** #include "sudo.h" #ifndef lint ! static const char rcsid[] = "$Sudo: logging.c,v 1.159 2003/03/24 21:09:27 millert Exp $"; #endif /* lint */ static void do_syslog __P((int, char *)); --- 70,76 ---- #include "sudo.h" #ifndef lint ! static const char rcsid[] = "$Sudo: logging.c,v 1.160 2003/04/02 18:25:19 millert Exp $"; #endif /* lint */ static void do_syslog __P((int, char *)); *************** *** 107,115 **** va_start(ap); #endif #ifdef LOG_NFACILITIES ! openlog(Argv[0], 0, def_ival(I_LOGFAC)); #else ! openlog(Argv[0], 0); #endif vsnprintf(buf, sizeof(buf), fmt, ap); #ifdef BROKEN_SYSLOG --- 112,120 ---- va_start(ap); #endif #ifdef LOG_NFACILITIES ! openlog("sudo", 0, def_ival(I_LOGFAC)); #else ! openlog("sudo", 0); #endif vsnprintf(buf, sizeof(buf), fmt, ap); #ifdef BROKEN_SYSLOG *************** *** 400,409 **** /* * Tell the user. */ - (void) fprintf(stderr, "%s: %s", Argv[0], message); if (flags & USE_ERRNO) ! (void) fprintf(stderr, ": %s", strerror(serrno)); ! (void) fputc('\n', stderr); /* * Send a copy of the error via mail. --- 405,414 ---- /* * Tell the user. */ if (flags & USE_ERRNO) ! warn("%s", message); ! else ! warnx("%s", message); /* * Send a copy of the error via mail. *************** *** 459,476 **** (void) sigaddset(&set, SIGCHLD); (void) sigprocmask(SIG_BLOCK, &set, &oset); ! if (pipe(pfd) == -1) { ! (void) fprintf(stderr, "%s: cannot open pipe: %s\n", ! Argv[0], strerror(errno)); ! exit(1); ! } switch (pid = fork()) { case -1: /* Error. */ ! (void) fprintf(stderr, "%s: cannot fork: %s\n", ! Argv[0], strerror(errno)); ! exit(1); break; case 0: { --- 464,476 ---- (void) sigaddset(&set, SIGCHLD); (void) sigprocmask(SIG_BLOCK, &set, &oset); ! if (pipe(pfd) == -1) ! err(1, "cannot open pipe"); switch (pid = fork()) { case -1: /* Error. */ ! err(1, "cannot fork"); break; case 0: {