summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtsold
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2011-06-08 04:06:56 +0000
committerhrs <hrs@FreeBSD.org>2011-06-08 04:06:56 +0000
commite8152d9ab6630d75c99873893546db5d51f19309 (patch)
tree25a06756a7c830b8667130a33fbbc4426f9c15f0 /usr.sbin/rtsold
parentb4b3d062cdd5a507afb962caa1fdd9a3d78abf9c (diff)
downloadFreeBSD-src-e8152d9ab6630d75c99873893546db5d51f19309.zip
FreeBSD-src-e8152d9ab6630d75c99873893546db5d51f19309.tar.gz
- Disable "resolvconf -d" temporarily to avoid extra invocations of the script
under a certain condition. - Fix argv handling. Spotted by: ume
Diffstat (limited to 'usr.sbin/rtsold')
-rw-r--r--usr.sbin/rtsold/rtsol.c2
-rw-r--r--usr.sbin/rtsold/rtsold.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c
index afa935e..fe8bfaf 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 a8b7ca7..a0eb593 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);
OpenPOWER on IntegriCloud