Browse Source

Replace errx with equivalent fprintf+exit to make porting easier; ok henning@

OPENBSD_3_6
dtucker 20 years ago
parent
commit
4b7b3363bd
4 changed files with 12 additions and 12 deletions
  1. +1
    -2
      src/usr.sbin/ntpd/buffer.c
  2. +1
    -2
      src/usr.sbin/ntpd/log.c
  3. +9
    -6
      src/usr.sbin/ntpd/ntpd.c
  4. +1
    -2
      src/usr.sbin/ntpd/parse.y

+ 1
- 2
src/usr.sbin/ntpd/buffer.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: buffer.c,v 1.1 2004/05/31 13:46:16 henning Exp $ */
/* $OpenBSD: buffer.c,v 1.2 2004/07/12 09:22:38 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -21,7 +21,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <err.h>
#include <errno.h>
#include <limits.h>
#include <string.h>


+ 1
- 2
src/usr.sbin/ntpd/log.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: log.c,v 1.5 2004/07/11 03:05:50 dtucker Exp $ */
/* $OpenBSD: log.c,v 1.6 2004/07/12 09:22:38 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -21,7 +21,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <err.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>


+ 9
- 6
src/usr.sbin/ntpd/ntpd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.c,v 1.10 2004/07/09 15:08:54 deraadt Exp $ */
/* $OpenBSD: ntpd.c,v 1.11 2004/07/12 09:22:38 dtucker Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -21,7 +21,6 @@
#include <sys/wait.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
@ -110,11 +109,15 @@ main(int argc, char *argv[])
if (parse_config(conffile, &conf))
exit(1);
if (geteuid())
errx(1, "need root privileges");
if (geteuid()) {
fprintf(stderr, "ntpd: need root privileges");
exit(1);
}
if (getpwnam(NTPD_USER) == NULL)
errx(1, "unknown user %s", NTPD_USER);
if (getpwnam(NTPD_USER) == NULL) {
fprintf(stderr, "ntpd: unknown user %s", NTPD_USER);
exit(1);
}
endpwent();
log_init(debug);


+ 1
- 2
src/usr.sbin/ntpd/parse.y View File

@ -1,4 +1,4 @@
/* $OpenBSD: parse.y,v 1.11 2004/07/09 19:28:03 otto Exp $ */
/* $OpenBSD: parse.y,v 1.12 2004/07/12 09:22:38 dtucker Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -26,7 +26,6 @@
#include <arpa/inet.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>


Loading…
Cancel
Save