summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authorremko <remko@FreeBSD.org>2008-03-22 12:50:43 +0000
committerremko <remko@FreeBSD.org>2008-03-22 12:50:43 +0000
commit89b08d11a7a3b73300a21c74f2bfb12da246303c (patch)
tree8ef66b38b2f4fb787157806d697839ac9210c962 /sbin/route
parent1423f22a4cfd25ee67c64722cb270d04a9baa2f6 (diff)
downloadFreeBSD-src-89b08d11a7a3b73300a21c74f2bfb12da246303c.zip
FreeBSD-src-89b08d11a7a3b73300a21c74f2bfb12da246303c.tar.gz
In route.c in newroute() there's a call to exit(0) if the command was
'get'. Since rtmsg() always gets called and returns 0 on success and -1 on failure, it's possible to exit with a suitable exit code by calling exit(ret != 0) instead, as is done at the end of newroute(). PR: bin/112303 Submitted by: bruce@cran.org.uk MFC after: 1 week
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index ed780dd..b94f457 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -748,7 +748,7 @@ newroute(argc, argv)
break;
}
if (*cmd == 'g')
- exit(0);
+ exit(ret != 0);
if (!qflag) {
oerrno = errno;
(void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
OpenPOWER on IntegriCloud