Browse Source

use a #define for the time to wait on -s and clarify a log msg

OPENBSD_3_8
henning 19 years ago
parent
commit
a16f15c2c3
2 changed files with 6 additions and 5 deletions
  1. +4
    -4
      src/usr.sbin/ntpd/ntpd.c
  2. +2
    -1
      src/usr.sbin/ntpd/ntpd.h

+ 4
- 4
src/usr.sbin/ntpd/ntpd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.c,v 1.37 2005/06/19 16:42:57 henning Exp $ */
/* $OpenBSD: ntpd.c,v 1.38 2005/06/19 17:11:13 henning Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -131,7 +131,7 @@ main(int argc, char *argv[])
if (daemon(1, 0)) if (daemon(1, 0))
fatal("daemon"); fatal("daemon");
} else } else
timeout = 15 * 1000;
timeout = SETTIME_TIMEOUT * 1000;
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_chld) == -1) if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_chld) == -1)
fatal("socketpair"); fatal("socketpair");
@ -168,8 +168,8 @@ main(int argc, char *argv[])
conf.settime = 0; conf.settime = 0;
timeout = INFTIM; timeout = INFTIM;
log_init(conf.debug); log_init(conf.debug);
log_debug("no reply received, skipping initial time "
"setting");
log_debug("no reply received in time, skipping initial "
"time setting");
if (!conf.debug) if (!conf.debug)
if (daemon(1, 0)) if (daemon(1, 0))
fatal("daemon"); fatal("daemon");


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

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.h,v 1.56 2005/06/19 16:42:57 henning Exp $ */
/* $OpenBSD: ntpd.h,v 1.57 2005/06/19 17:11:13 henning Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -55,6 +55,7 @@
#define QUERYTIME_MAX 15 /* single query might take n secs max */ #define QUERYTIME_MAX 15 /* single query might take n secs max */
#define OFFSET_ARRAY_SIZE 8 #define OFFSET_ARRAY_SIZE 8
#define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */ #define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */
#define SETTIME_TIMEOUT 15 /* max seconds to wait with -s */
#define LOG_NEGLIGEE 128 /* negligible drift to not log (ms) */ #define LOG_NEGLIGEE 128 /* negligible drift to not log (ms) */
enum client_state { enum client_state {


Loading…
Cancel
Save