diff options
author | Remko Lodder <remko@FreeBSD.org> | 2008-03-22 12:50:43 +0000 |
---|---|---|
committer | Remko Lodder <remko@FreeBSD.org> | 2008-03-22 12:50:43 +0000 |
commit | 6764f54349ce0d61f7f5465bfbb8acda7681893d (patch) | |
tree | 8ef66b38b2f4fb787157806d697839ac9210c962 /sbin/route | |
parent | 9939a13667567dd4b0c3496953d99b87a6995208 (diff) | |
download | src-6764f54349ce0d61f7f5465bfbb8acda7681893d.tar.gz src-6764f54349ce0d61f7f5465bfbb8acda7681893d.zip |
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
Notes
Notes:
svn path=/head/; revision=177496
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/route.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index ed780dd5b7e0..b94f457054db 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); |