aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorEugene Grosbein <eugen@FreeBSD.org>2018-10-27 07:59:19 +0000
committerEugene Grosbein <eugen@FreeBSD.org>2018-10-27 07:59:19 +0000
commit281411684915d88ca71c9e853fb718d77463fae8 (patch)
tree7a634b7cf1832481c704a61025cc4e4243eef3fc /sbin
parent5310c191741e6b26b007f02cec3236787228ba69 (diff)
downloadsrc-281411684915d88ca71c9e853fb718d77463fae8.tar.gz
src-281411684915d88ca71c9e853fb718d77463fae8.zip
route(8): correctly return exit status when "-q" flag is used.
Previously, route returned 1 in case of error properly signalling failure but "route -q" it returned 0 for same case. Fix it. PR: 186333 MFC after: 1 month
Notes
Notes: svn path=/head/; revision=339811
Diffstat (limited to 'sbin')
-rw-r--r--sbin/route/route.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 79ec08972738..9c9e4b304848 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1050,10 +1050,13 @@ newroute(int argc, char **argv)
}
printf("\n");
}
+ }
- fibnum = 0;
- TAILQ_FOREACH(fl, &fibl_head, fl_next) {
- if (fl->fl_error != 0) {
+ fibnum = 0;
+ TAILQ_FOREACH(fl, &fibl_head, fl_next) {
+ if (fl->fl_error != 0) {
+ error = 1;
+ if (!qflag) {
printf("%s %s %s", cmd, (nrflags & F_ISHOST)
? "host" : "net", dest);
if (*gateway)
@@ -1087,7 +1090,6 @@ newroute(int argc, char **argv)
break;
}
printf(": %s\n", errmsg);
- error = 1;
}
}
}