Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/routed unifdef sgi. NFCI
details: https://anonhg.NetBSD.org/src/rev/67efb1422860
branches: trunk
changeset: 356548:67efb1422860
user: maya <maya%NetBSD.org@localhost>
date: Mon Oct 02 11:02:19 2017 +0000
description:
unifdef sgi. NFCI
diffstat:
sbin/routed/defs.h | 26 ++------------------------
sbin/routed/if.c | 19 ++++---------------
sbin/routed/main.c | 13 ++-----------
sbin/routed/trace.c | 15 +++------------
4 files changed, 11 insertions(+), 62 deletions(-)
diffs (214 lines):
diff -r b0d2f005b875 -r 67efb1422860 sbin/routed/defs.h
--- a/sbin/routed/defs.h Mon Oct 02 10:08:11 2017 +0000
+++ b/sbin/routed/defs.h Mon Oct 02 11:02:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.27 2012/02/12 13:56:56 wiz Exp $ */
+/* $NetBSD: defs.h,v 1.28 2017/10/02 11:02:19 maya Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -69,10 +69,6 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#ifdef sgi
-#include <strings.h>
-#include <bstring.h>
-#endif
#include <stdarg.h>
#include <syslog.h>
#include <time.h>
@@ -83,14 +79,9 @@
#include <sys/ioctl.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
-#ifdef sgi
-#define _USER_ROUTE_TREE
-#include <net/radix.h>
-#else
#include "radix.h"
#define UNUSED __attribute__((unused))
#define PATTRIB(f,l) __attribute__((format (printf,f,l)))
-#endif
#include <net/if.h>
#include <net/route.h>
#include <net/if_dl.h>
@@ -112,9 +103,7 @@
* So define it here so it can be changed for the target system.
* It should be defined somewhere netinet/in.h, but it is not.
*/
-#ifdef sgi
-#define naddr u_int32_t
-#elif defined (__NetBSD__)
+#if defined (__NetBSD__)
#define naddr u_int32_t
#define _HAVE_SA_LEN
#define _HAVE_SIN_LEN
@@ -161,9 +150,7 @@
/* Router Discovery parameters */
-#ifndef sgi
#define INADDR_ALLROUTERS_GROUP 0xe0000002 /* 224.0.0.2 */
-#endif
#define MaxMaxAdvertiseInterval 1800
#define MinMaxAdvertiseInterval 4
#define DefMaxAdvertiseInterval 600
@@ -311,9 +298,6 @@
u_int ierrors;
u_int opackets;
u_int oerrors;
-#ifdef sgi
- u_int odrops;
-#endif
time_t ts; /* timestamp on network stats */
} int_data;
# define MAX_AUTH_KEYS 5
@@ -520,12 +504,6 @@
extern struct radix_node_head *rhead;
-
-#ifdef sgi
-/* Fix conflicts */
-#define dup2(x,y) BSDdup2(x,y)
-#endif /* sgi */
-
extern void fix_sock(int, const char *);
extern void fix_select(void);
extern void rip_off(void);
diff -r b0d2f005b875 -r 67efb1422860 sbin/routed/if.c
--- a/sbin/routed/if.c Mon Oct 02 10:08:11 2017 +0000
+++ b/sbin/routed/if.c Mon Oct 02 11:02:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.30 2012/06/24 16:24:34 kardel Exp $ */
+/* $NetBSD: if.c,v 1.31 2017/10/02 11:02:19 maya Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
#include "pathnames.h"
#ifdef __NetBSD__
-__RCSID("$NetBSD: if.c,v 1.30 2012/06/24 16:24:34 kardel Exp $");
+__RCSID("$NetBSD: if.c,v 1.31 2017/10/02 11:02:19 maya Exp $");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
@@ -770,9 +770,7 @@
ifs0.int_data.ierrors = ifm.ifm_data.ifi_ierrors;
ifs0.int_data.opackets = ifm.ifm_data.ifi_opackets;
ifs0.int_data.oerrors = ifm.ifm_data.ifi_oerrors;
-#ifdef sgi
- ifs0.int_data.odrops = ifm.ifm_data.ifi_odrops;
-#endif
+
sdl = (const struct sockaddr_dl *)
((struct if_msghdr *)ifam + 1);
/* NUL-termination by memset, above. */
@@ -1011,16 +1009,7 @@
ierr = ifs.int_data.ierrors - ifp->int_data.ierrors;
out = ifs.int_data.opackets - ifp->int_data.opackets;
oerr = ifs.int_data.oerrors - ifp->int_data.oerrors;
-#ifdef sgi
- /* Through at least IRIX 6.2, PPP and SLIP
- * count packets dropped by the filters.
- * But FDDI rings stuck non-operational count
- * dropped packets as they wait for improvement.
- */
- if (!(ifp->int_if_flags & IFF_POINTOPOINT))
- oerr += (ifs.int_data.odrops
- - ifp->int_data.odrops);
-#endif
+
/* If the interface just awoke, restart the counters.
*/
if (ifp->int_data.ts == 0) {
diff -r b0d2f005b875 -r 67efb1422860 sbin/routed/main.c
--- a/sbin/routed/main.c Mon Oct 02 10:08:11 2017 +0000
+++ b/sbin/routed/main.c Mon Oct 02 11:02:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.41 2009/10/26 02:53:15 christos Exp $ */
+/* $NetBSD: main.c,v 1.42 2017/10/02 11:02:19 maya Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -35,9 +35,6 @@
#include "defs.h"
#include "pathnames.h"
-#ifdef sgi
-#include "math.h"
-#endif
#if defined(__NetBSD__)
#include <util.h>
#endif
@@ -48,7 +45,7 @@
__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\
The Regents of the University of California. All rights reserved.");
#ifdef __NetBSD__
-__RCSID("$NetBSD: main.c,v 1.41 2009/10/26 02:53:15 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.42 2017/10/02 11:02:19 maya Exp $");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
@@ -288,14 +285,8 @@
signal(SIGUSR2, sigtrace_off);
/* get into the background */
-#ifdef sgi
- if (0 > _daemonize(background ? 0 : (_DF_NOCHDIR|_DF_NOFORK),
- STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO))
- BADERR(0, "_daemonize()");
-#else
if (background && daemon(0, 1) < 0)
BADERR(0,"daemon()");
-#endif
#if defined(__NetBSD__)
pidfile(NULL);
diff -r b0d2f005b875 -r 67efb1422860 sbin/routed/trace.c
--- a/sbin/routed/trace.c Mon Oct 02 10:08:11 2017 +0000
+++ b/sbin/routed/trace.c Mon Oct 02 11:02:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trace.c,v 1.32 2009/04/06 12:36:27 lukem Exp $ */
+/* $NetBSD: trace.c,v 1.33 2017/10/02 11:02:19 maya Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -41,7 +41,7 @@
#include <fcntl.h>
#ifdef __NetBSD__
-__RCSID("$NetBSD: trace.c,v 1.32 2009/04/06 12:36:27 lukem Exp $");
+__RCSID("$NetBSD: trace.c,v 1.33 2017/10/02 11:02:19 maya Exp $");
#elif defined(__FreeBSD__)
__RCSID("$FreeBSD$");
#else
@@ -49,12 +49,6 @@
#ident "Revision: 2.27 "
#endif
-
-#ifdef sgi
-/* use *stat64 for files on large filesystems */
-#define stat stat64
-#endif
-
#define NRECORDS 50 /* size of circular trace buffer */
int tracelevel, new_tracelevel;
@@ -158,12 +152,9 @@
static char s[20];
secs += epoch.tv_sec;
-#ifdef sgi
- (void)cftime(s, "%T", &secs);
-#else
memcpy(s, ctime(&secs)+11, 8);
s[8] = '\0';
-#endif
+
return s;
}
Home |
Main Index |
Thread Index |
Old Index