From 55a2645084ee1947ed7d491594af26001940ccea Mon Sep 17 00:00:00 2001 From: remko Date: Sat, 29 Mar 2008 13:44:36 +0000 Subject: [PATCH] MFC rev 1.84 route.c 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 Approved by: imp (mentor, implicit) --- sbin/route/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index d5b000fb8b4a..782ea3f717c2 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -747,7 +747,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);