diff options
author | hrs <hrs@FreeBSD.org> | 2011-06-08 04:06:56 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-06-08 04:06:56 +0000 |
commit | e8152d9ab6630d75c99873893546db5d51f19309 (patch) | |
tree | 25a06756a7c830b8667130a33fbbc4426f9c15f0 /usr.sbin/rtsold/rtsold.c | |
parent | b4b3d062cdd5a507afb962caa1fdd9a3d78abf9c (diff) | |
download | FreeBSD-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/rtsold.c')
-rw-r--r-- | usr.sbin/rtsold/rtsold.c | 7 |
1 files changed, 5 insertions, 2 deletions
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); |