Deleted Added
full compact
rwhod.c (220969) rwhod.c (229403)
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 26 unchanged lines hidden (view full) ---

35
36#if 0
37#ifndef lint
38static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";
39#endif /* not lint */
40#endif
41
42#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 26 unchanged lines hidden (view full) ---

35
36#if 0
37#ifndef lint
38static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";
39#endif /* not lint */
40#endif
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/usr.sbin/rwhod/rwhod.c 220969 2011-04-23 13:42:03Z simon $");
43__FBSDID("$FreeBSD: head/usr.sbin/rwhod/rwhod.c 229403 2012-01-03 18:51:58Z ed $");
44
45#include <sys/param.h>
46#include <sys/socket.h>
47#include <sys/stat.h>
48#include <sys/signal.h>
49#include <sys/ioctl.h>
50#include <sys/sysctl.h>
51

--- 170 unchanged lines hidden (view full) ---

222 }
223 /*
224 * Establish host name as returned by system.
225 */
226 if (gethostname(myname, sizeof(myname) - 1) < 0) {
227 syslog(LOG_ERR, "gethostname: %m");
228 exit(1);
229 }
44
45#include <sys/param.h>
46#include <sys/socket.h>
47#include <sys/stat.h>
48#include <sys/signal.h>
49#include <sys/ioctl.h>
50#include <sys/sysctl.h>
51

--- 170 unchanged lines hidden (view full) ---

222 }
223 /*
224 * Establish host name as returned by system.
225 */
226 if (gethostname(myname, sizeof(myname) - 1) < 0) {
227 syslog(LOG_ERR, "gethostname: %m");
228 exit(1);
229 }
230 if ((cp = index(myname, '.')) != NULL)
230 if ((cp = strchr(myname, '.')) != NULL)
231 *cp = '\0';
232 strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1);
233 mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0';
234 getboottime(0);
235 if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
236 syslog(LOG_ERR, "socket: %m");
237 exit(1);
238 }

--- 472 unchanged lines hidden ---
231 *cp = '\0';
232 strncpy(mywd.wd_hostname, myname, sizeof(mywd.wd_hostname) - 1);
233 mywd.wd_hostname[sizeof(mywd.wd_hostname) - 1] = '\0';
234 getboottime(0);
235 if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
236 syslog(LOG_ERR, "socket: %m");
237 exit(1);
238 }

--- 472 unchanged lines hidden ---