naccyde / rpms / iproute

Forked from rpms/iproute 5 months ago
Clone

Blame SOURCES/0016-ss-return-1-if-an-unrecognized-option-was-given.patch

049c96
From c74eb4b7e9ca7cade47d0c3b23876cc6527b8774 Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Thu, 18 Feb 2016 13:33:36 +0100
049c96
Subject: [PATCH] ss: return -1 if an unrecognized option was given
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1265238
049c96
Upstream Status: iproute2.git commit f73105ab42795
049c96
049c96
commit f73105ab42795422f131fb711712e3c860df982f
049c96
Author: Phil Sutter <phil@nwl.cc>
049c96
Date:   Thu Oct 15 21:01:16 2015 +0200
049c96
049c96
    ss: return -1 if an unrecognized option was given
049c96
049c96
    When getopt_long encounters an option which has not been registered, it
049c96
    returns '?'. React upon that and call usage() instead of help() so ss
049c96
    returns with a non-zero exit status.
049c96
049c96
    Signed-off-by: Phil Sutter <phil@nwl.cc>
049c96
---
049c96
 misc/ss.c | 2 +-
049c96
 1 file changed, 1 insertion(+), 1 deletion(-)
049c96
049c96
diff --git a/misc/ss.c b/misc/ss.c
049c96
index fd9a1f9..b9b2081 100644
049c96
--- a/misc/ss.c
049c96
+++ b/misc/ss.c
049c96
@@ -3605,8 +3605,8 @@ int main(int argc, char *argv[])
049c96
 				exit(1);
049c96
 			break;
049c96
 		case 'h':
049c96
-		case '?':
049c96
 			help();
049c96
+		case '?':
049c96
 		default:
049c96
 			usage();
049c96
 		}
049c96
-- 
049c96
1.8.3.1
049c96