diff options
author | ume <ume@FreeBSD.org> | 2004-01-14 17:59:38 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2004-01-14 17:59:38 +0000 |
commit | ff9ef7b64130048cb0de17257700f769628cf27c (patch) | |
tree | ef06316cf8e7b12c1eacfcbcf9e7e288ebdc9b11 | |
parent | 7fa7bd6ad2ca27f28c91cc116d9cad1aabbf9e73 (diff) | |
download | FreeBSD-src-ff9ef7b64130048cb0de17257700f769628cf27c.zip FreeBSD-src-ff9ef7b64130048cb0de17257700f769628cf27c.tar.gz |
-DSMALL will remove the need of dump.c (for rtsol)
Obtained from: KAME
-rw-r--r-- | sbin/rtsol/Makefile | 4 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/sbin/rtsol/Makefile b/sbin/rtsol/Makefile index d6baa1e..c68ef2da 100644 --- a/sbin/rtsol/Makefile +++ b/sbin/rtsol/Makefile @@ -16,9 +16,9 @@ SRCDIR= ${.CURDIR}/../../usr.sbin/rtsold PROG= rtsol -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= rtsold.c rtsol.c if.c probe.c rtsock.c -CFLAGS+=-DINET6 -DHAVE_ARC4RANDOM -DHAVE_POLL_H +CFLAGS+=-DINET6 -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DSMALL WARNS= 0 NOMAN= yes diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index bfdbc68..f9dca79 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -84,9 +84,13 @@ int main __P((int, char **)); /* static variables and functions */ static int mobile_node = 0; +#ifndef SMALL static int do_dump; static char *dumpfilename = "/var/run/rtsold.dump"; /* XXX: should be configurable */ +#endif +#if 1 static char *pidfilename = "/var/run/rtsold.pid"; /* should be configurable */ +#endif #if 0 static int ifreconfig __P((char *)); @@ -94,7 +98,9 @@ static int ifreconfig __P((char *)); static int make_packet __P((struct ifinfo *)); static struct timeval *rtsol_check_timer __P((void)); +#ifndef SMALL static void rtsold_set_dump_file __P((int)); +#endif static void usage __P((char *)); int @@ -202,8 +208,10 @@ main(int argc, char **argv) warnx("kernel is configured as a router, not a host"); } +#ifndef SMALL /* initialization to dump internal status to a file */ signal(SIGUSR1, rtsold_set_dump_file); +#endif if (!fflag) daemon(0, 0); /* act as a daemon */ @@ -281,6 +289,7 @@ main(int argc, char **argv) /*NOTREACHED*/ } +#if 1 /* dump the current pid */ if (!once) { pid_t pid = getpid(); @@ -295,6 +304,7 @@ main(int argc, char **argv) fclose(fp); } } +#endif #ifndef HAVE_POLL_H memset(fdsetp, 0, fdmasks); @@ -308,10 +318,12 @@ main(int argc, char **argv) memcpy(selectfdp, fdsetp, fdmasks); #endif +#ifndef SMALL if (do_dump) { /* SIGUSR1 */ do_dump = 0; rtsold_dump_file(dumpfilename); } +#endif timeout = rtsol_check_timer(); @@ -719,11 +731,13 @@ rtsol_timer_update(struct ifinfo *ifinfo) /* timer related utility functions */ #define MILLION 1000000 +#ifndef SMALL static void rtsold_set_dump_file(int sig) { do_dump = 1; } +#endif static void usage(char *progname) |