summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtsold/rtsold.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-01-14 17:59:38 +0000
committerume <ume@FreeBSD.org>2004-01-14 17:59:38 +0000
commitff9ef7b64130048cb0de17257700f769628cf27c (patch)
treeef06316cf8e7b12c1eacfcbcf9e7e288ebdc9b11 /usr.sbin/rtsold/rtsold.c
parent7fa7bd6ad2ca27f28c91cc116d9cad1aabbf9e73 (diff)
downloadFreeBSD-src-ff9ef7b64130048cb0de17257700f769628cf27c.zip
FreeBSD-src-ff9ef7b64130048cb0de17257700f769628cf27c.tar.gz
-DSMALL will remove the need of dump.c (for rtsol)
Obtained from: KAME
Diffstat (limited to 'usr.sbin/rtsold/rtsold.c')
-rw-r--r--usr.sbin/rtsold/rtsold.c14
1 files changed, 14 insertions, 0 deletions
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)
OpenPOWER on IntegriCloud