diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2011-06-08 04:06:56 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2011-06-08 04:06:56 +0000 |
commit | b4da9fbccda100db9a1d312914227875025859da (patch) | |
tree | 25a06756a7c830b8667130a33fbbc4426f9c15f0 | |
parent | ffe8cd7b104ecc8969ec36c065629f1b70c3b3f5 (diff) | |
download | src-b4da9fbccda100db9a1d312914227875025859da.tar.gz src-b4da9fbccda100db9a1d312914227875025859da.zip |
- Disable "resolvconf -d" temporarily to avoid extra invocations of the script
under a certain condition.
- Fix argv handling.
Spotted by: ume
Notes
Notes:
svn path=/head/; revision=222848
-rw-r--r-- | usr.sbin/rtsold/rtsol.c | 2 | ||||
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index afa935e72da7..fe8bfaf5d08e 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -625,8 +625,10 @@ free1: if (!TAILQ_EMPTY(&sm_rdnss_head)) CALL_SCRIPT(RESADD, &sm_rdnss_head); +#if 0 else CALL_SCRIPT(RESDEL, NULL); +#endif ra_opt_handler_freeit: /* Clear script message queue. */ diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index a8b7ca727cfd..a0eb5939169a 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -124,6 +124,7 @@ main(int argc, char **argv) int maxfd; #endif int rtsock; + char *argv0; #ifndef SMALL /* rtsold */ @@ -134,6 +135,8 @@ main(int argc, char **argv) fflag = 1; once = 1; #endif + argv0 = argv[0]; + while ((ch = getopt(argc, argv, opts)) != -1) { switch (ch) { case 'a': @@ -185,9 +188,9 @@ main(int argc, char **argv) if (!fflag) { char *ident; - ident = strrchr(argv[0], '/'); + ident = strrchr(argv0, '/'); if (!ident) - ident = argv[0]; + ident = argv0; else ident++; openlog(ident, LOG_NDELAY|LOG_PID, LOG_DAEMON); |