From 357bd33b86c79a0ef11483ba2e6d60c3e2711630 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 3 Feb 1994 23:23:18 +0000 Subject: [PATCH] Use uname(2) to get OS name and arch. --- usr.sbin/xntpd/xntpd/Makefile | 5 +++-- usr.sbin/xntpd/xntpd/ntp_control.c | 21 ++++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/usr.sbin/xntpd/xntpd/Makefile b/usr.sbin/xntpd/xntpd/Makefile index b880bca92aab..1f9c7471a667 100644 --- a/usr.sbin/xntpd/xntpd/Makefile +++ b/usr.sbin/xntpd/xntpd/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.2 1993/12/22 11:33:47 rgrimes Exp $ +# $Id: Makefile,v 1.3 1993/12/23 10:21:55 rgrimes Exp $ # CFLAGS+= -I${.CURDIR}/../include @@ -34,7 +34,8 @@ SRCS= ntp_config.c ntp_control.c ntp_io.c ntp_leap.c \ refclock_wwvb.c refclock_goes.c refclock_mx4200.c \ refclock_parse.c refclock_as2201.c refclock_omega.c \ refclock_tpro.c refclock_leitch.c refclock_irig.c \ - refclock_msfees.c ntp_intres.c ntp_filegen.c version.c + refclock_msfees.c refclock_gpstm.c ntp_intres.c \ + ntp_filegen.c version.c beforedepend: version.c diff --git a/usr.sbin/xntpd/xntpd/ntp_control.c b/usr.sbin/xntpd/xntpd/ntp_control.c index f63836704b2c..1c7849f48820 100644 --- a/usr.sbin/xntpd/xntpd/ntp_control.c +++ b/usr.sbin/xntpd/xntpd/ntp_control.c @@ -264,15 +264,8 @@ static u_char def_clock_var[] = { /* * System and processor definitions. These will change for the gizmo board. */ -#ifndef STR_SYSTEM -#define STR_SYSTEM "UNIX" -#endif -#ifndef STR_PROCESSOR -#define STR_PROCESSOR "unknown" -#endif - -static char str_system[] = STR_SYSTEM; -static char str_processor[] = STR_PROCESSOR; +#include +static struct utsname utsname; /* * Trap structures. We only allow a few of these, and send @@ -433,6 +426,8 @@ init_control() { int i; + uname(&utsname); + ctl_clr_stats(); ctl_auth_keyid = 0; @@ -1267,12 +1262,12 @@ ctl_putsys(varid) ctl_putuint(sys_var[CS_LEAPWARNING].text, (U_LONG)leap_warning); break; case CS_PROCESSOR: - ctl_putstr(sys_var[CS_PROCESSOR].text, str_processor, - sizeof(str_processor) - 1); + ctl_putstr(sys_var[CS_PROCESSOR].text, utsname.machine, + strlen(utsname.machine)); break; case CS_SYSTEM: - ctl_putstr(sys_var[CS_SYSTEM].text, str_system, - sizeof(str_system) - 1); + ctl_putstr(sys_var[CS_SYSTEM].text, utsname.sysname, + strlen(utsname.sysname)); break; case CS_KEYID: ctl_putuint(sys_var[CS_KEYID].text, (U_LONG)0);