blob: d5176f80b9136af05ba2a64fae5a0eb7542fbdf8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
--- a/usr/iscsiadm.c 2016-09-29 20:33:24.000000000 +0200
+++ b/usr/iscsiadm.c 2017-01-08 03:03:20.648496369 +0100
@@ -3263,7 +3263,8 @@
int packet_size=32, ping_count=1, ping_interval=0;
int do_discover = 0, sub_mode = -1;
int portal_type = -1;
int timeout = ISCSID_REQ_TIMEOUT;
+ int argerror = 0;
struct sigaction sa_old;
struct sigaction sa_new;
struct list_head ifaces;
@@ -3426,6 +3427,11 @@
break;
case 'h':
usage(0);
+ break;
+ case '?':
+ log_error("unrecognized character '%c'", optopt);
+ argerror = 1;
+ break;
}
if (name && value) {
@@ -3441,8 +3446,7 @@
}
}
- if (optopt) {
- log_error("unrecognized character '%c'", optopt);
+ if (argerror) {
rc = ISCSI_ERR_INVAL;
goto free_ifaces;
}
|