summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 0cffaeb..866044b 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -174,7 +174,6 @@ process_arguments (int argc, char **argv)
174 char *p1, *p2; 174 char *p1, *p2;
175 size_t len; 175 size_t len;
176 176
177#ifdef HAVE_GETOPT_H
178 int option_index = 0; 177 int option_index = 0;
179 static struct option long_options[] = { 178 static struct option long_options[] = {
180 {"version", no_argument, 0, 'V'}, 179 {"version", no_argument, 0, 'V'},
@@ -195,7 +194,6 @@ process_arguments (int argc, char **argv)
195 {"use-ipv6", no_argument, 0, '6'}, 194 {"use-ipv6", no_argument, 0, '6'},
196 {0, 0, 0, 0} 195 {0, 0, 0, 0}
197 }; 196 };
198#endif
199 197
200 if (argc < 2) 198 if (argc < 2)
201 return ERROR; 199 return ERROR;
@@ -205,13 +203,8 @@ process_arguments (int argc, char **argv)
205 strcpy (argv[c], "-t"); 203 strcpy (argv[c], "-t");
206 204
207 while (1) { 205 while (1) {
208#ifdef HAVE_GETOPT_H 206 c = getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
209 c =
210 getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
211 &option_index); 207 &option_index);
212#else
213 c = getopt (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:");
214#endif
215 208
216 if (c == -1 || c == EOF) 209 if (c == -1 || c == EOF)
217 break; 210 break;
diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 5c6f1e1..59c3b7c 100644
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
@@ -146,7 +146,6 @@ process_arguments (int argc, char **argv)
146{ 146{
147 int c; 147 int c;
148 148
149#ifdef HAVE_GETOPT_H
150 int option_index = 0; 149 int option_index = 0;
151 static struct option long_options[] = { 150 static struct option long_options[] = {
152 {"hostname", required_argument, 0, 'H'}, 151 {"hostname", required_argument, 0, 'H'},
@@ -156,17 +155,12 @@ process_arguments (int argc, char **argv)
156 {"help", no_argument, 0, 'h'}, 155 {"help", no_argument, 0, 'h'},
157 {0, 0, 0, 0} 156 {0, 0, 0, 0}
158 }; 157 };
159#endif
160 158
161 if (argc < 2) 159 if (argc < 2)
162 return ERROR; 160 return ERROR;
163 161
164 while (1) { 162 while (1) {
165#ifdef HAVE_GETOPT_H
166 c = getopt_long (argc, argv, "hVvt:l:H:", long_options, &option_index); 163 c = getopt_long (argc, argv, "hVvt:l:H:", long_options, &option_index);
167#else
168 c = getopt (argc, argv, "hVvt:l:H:");
169#endif
170 164
171 if (c == -1 || c == EOF) 165 if (c == -1 || c == EOF)
172 break; 166 break;
diff --git a/plugins/check_disk.c b/plugins/check_disk.c
index 1afc762..5fac4ea 100644
--- a/plugins/check_disk.c
+++ b/plugins/check_disk.c
@@ -217,7 +217,6 @@ process_arguments (int argc, char **argv)
217{ 217{
218 int c; 218 int c;
219 219
220#ifdef HAVE_GETOPT_H
221 int option_index = 0; 220 int option_index = 0;
222 static struct option long_options[] = { 221 static struct option long_options[] = {
223 {"warning", required_argument, 0, 'w'}, 222 {"warning", required_argument, 0, 'w'},
@@ -235,7 +234,6 @@ process_arguments (int argc, char **argv)
235 234
236 {0, 0, 0, 0} 235 {0, 0, 0, 0}
237 }; 236 };
238#endif
239 237
240 if (argc < 2) 238 if (argc < 2)
241 return ERROR; 239 return ERROR;
@@ -245,12 +243,7 @@ process_arguments (int argc, char **argv)
245 strcpy (argv[c], "-t"); 243 strcpy (argv[c], "-t");
246 244
247 while (1) { 245 while (1) {
248#ifdef HAVE_GETOPT_H 246 c = getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
249 c =
250 getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
251#else
252 c = getopt (argc, argv, "+?Vqhvet:c:w:p:x:m");
253#endif
254 247
255 if (c == -1 || c == EOF) 248 if (c == -1 || c == EOF)
256 break; 249 break;
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index ac62c45..7c79893 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -262,7 +262,6 @@ process_arguments (int argc, char **argv)
262{ 262{
263 int c; 263 int c;
264 264
265#ifdef HAVE_GETOPT_H
266 int opt_index = 0; 265 int opt_index = 0;
267 static struct option long_opts[] = { 266 static struct option long_opts[] = {
268 {"help", no_argument, 0, 'h'}, 267 {"help", no_argument, 0, 'h'},
@@ -275,7 +274,6 @@ process_arguments (int argc, char **argv)
275 {"expected-address", required_argument, 0, 'a'}, 274 {"expected-address", required_argument, 0, 'a'},
276 {0, 0, 0, 0} 275 {0, 0, 0, 0}
277 }; 276 };
278#endif
279 277
280 if (argc < 2) 278 if (argc < 2)
281 return ERROR; 279 return ERROR;
@@ -285,11 +283,7 @@ process_arguments (int argc, char **argv)
285 strcpy (argv[c], "-t"); 283 strcpy (argv[c], "-t");
286 284
287 while (1) { 285 while (1) {
288#ifdef HAVE_GETOPT_H
289 c = getopt_long (argc, argv, "hVvt:H:s:r:a:", long_opts, &opt_index); 286 c = getopt_long (argc, argv, "hVvt:H:s:r:a:", long_opts, &opt_index);
290#else
291 c = getopt (argc, argv, "hVvt:H:s:r:a:");
292#endif
293 287
294 if (c == -1 || c == EOF) 288 if (c == -1 || c == EOF)
295 break; 289 break;
diff --git a/plugins/check_fping.c b/plugins/check_fping.c
index 8887afe..ac203f5 100644
--- a/plugins/check_fping.c
+++ b/plugins/check_fping.c
@@ -202,7 +202,6 @@ process_arguments (int argc, char **argv)
202 int c; 202 int c;
203 char *rv[2]; 203 char *rv[2];
204 204
205#ifdef HAVE_GETOPT_H
206 int option_index = 0; 205 int option_index = 0;
207 static struct option long_options[] = { 206 static struct option long_options[] = {
208 {"hostname", required_argument, 0, 'H'}, 207 {"hostname", required_argument, 0, 'H'},
@@ -215,7 +214,6 @@ process_arguments (int argc, char **argv)
215 {"help", no_argument, 0, 'h'}, 214 {"help", no_argument, 0, 'h'},
216 {0, 0, 0, 0} 215 {0, 0, 0, 0}
217 }; 216 };
218#endif
219 217
220 rv[PL] = NULL; 218 rv[PL] = NULL;
221 rv[RTA] = NULL; 219 rv[RTA] = NULL;
@@ -231,12 +229,7 @@ process_arguments (int argc, char **argv)
231 } 229 }
232 230
233 while (1) { 231 while (1) {
234#ifdef HAVE_GETOPT_H 232 c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
235 c =
236 getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
237#else
238 c = getopt (argc, argv, "+hVvH:c:w:b:n:");
239#endif
240 233
241 if (c == -1 || c == EOF || c == 1) 234 if (c == -1 || c == EOF || c == 1)
242 break; 235 break;
diff --git a/plugins/check_hpjd.c b/plugins/check_hpjd.c
index 267de2e..d858372 100644
--- a/plugins/check_hpjd.c
+++ b/plugins/check_hpjd.c
@@ -390,7 +390,6 @@ process_arguments (int argc, char **argv)
390{ 390{
391 int c; 391 int c;
392 392
393#ifdef HAVE_GETOPT_H
394 int option_index = 0; 393 int option_index = 0;
395 static struct option long_options[] = { 394 static struct option long_options[] = {
396 {"hostname", required_argument, 0, 'H'}, 395 {"hostname", required_argument, 0, 'H'},
@@ -402,18 +401,13 @@ process_arguments (int argc, char **argv)
402 {"help", no_argument, 0, 'h'}, 401 {"help", no_argument, 0, 'h'},
403 {0, 0, 0, 0} 402 {0, 0, 0, 0}
404 }; 403 };
405#endif
406 404
407 if (argc < 2) 405 if (argc < 2)
408 return ERROR; 406 return ERROR;
409 407
410 408
411 while (1) { 409 while (1) {
412#ifdef HAVE_GETOPT_H
413 c = getopt_long (argc, argv, "+hVH:C:", long_options, &option_index); 410 c = getopt_long (argc, argv, "+hVH:C:", long_options, &option_index);
414#else
415 c = getopt (argc, argv, "+?hVH:C:");
416#endif
417 411
418 if (c == -1 || c == EOF || c == 1) 412 if (c == -1 || c == EOF || c == 1)
419 break; 413 break;
diff --git a/plugins/check_http.c b/plugins/check_http.c
index cf86d46..d6f2c15 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -296,7 +296,6 @@ process_arguments (int argc, char **argv)
296{ 296{
297 int c = 1; 297 int c = 1;
298 298
299#ifdef HAVE_GETOPT_H
300 int option_index = 0; 299 int option_index = 0;
301 static struct option long_options[] = { 300 static struct option long_options[] = {
302 STD_LONG_OPTS, 301 STD_LONG_OPTS,
@@ -317,7 +316,6 @@ process_arguments (int argc, char **argv)
317 {"min", required_argument, 0, 'm'}, 316 {"min", required_argument, 0, 'm'},
318 {0, 0, 0, 0} 317 {0, 0, 0, 0}
319 }; 318 };
320#endif
321 319
322 if (argc < 2) 320 if (argc < 2)
323 return ERROR; 321 return ERROR;
@@ -335,14 +333,8 @@ process_arguments (int argc, char **argv)
335 strcpy (argv[c], "-n"); 333 strcpy (argv[c], "-n");
336 } 334 }
337 335
338#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:"
339
340 while (1) { 336 while (1) {
341#ifdef HAVE_GETOPT_H 337 c = getopt_long (argc, argv, "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index);
342 c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
343#else
344 c = getopt (argc, argv, OPTCHARS);
345#endif
346 if (c == -1 || c == EOF) 338 if (c == -1 || c == EOF)
347 break; 339 break;
348 340
@@ -1068,12 +1060,7 @@ void
1068print_usage (void) 1060print_usage (void)
1069{ 1061{
1070 printf ("Usage:\n" " %s %s\n" 1062 printf ("Usage:\n" " %s %s\n"
1071#ifdef HAVE_GETOPT_H
1072 " %s (-h | --help) for detailed help\n" 1063 " %s (-h | --help) for detailed help\n"
1073 " %s (-V | --version) for version information\n", 1064 " %s (-V | --version) for version information\n",
1074#else
1075 " %s -h for detailed help\n"
1076 " %s -V for version information\n",
1077#endif
1078 progname, OPTIONS, progname, progname); 1065 progname, OPTIONS, progname, progname);
1079} 1066}
diff --git a/plugins/check_ide-smart.c b/plugins/check_ide-smart.c
index 869f7dc..47d9d84 100644
--- a/plugins/check_ide-smart.c
+++ b/plugins/check_ide-smart.c
@@ -44,7 +44,6 @@
44#include <unistd.h> 44#include <unistd.h>
45#include <linux/hdreg.h> 45#include <linux/hdreg.h>
46#include <linux/types.h> 46#include <linux/types.h>
47#include <getopt.h>
48#include <errno.h> 47#include <errno.h>
49 48
50#define NR_ATTRIBUTES 30 49#define NR_ATTRIBUTES 30
@@ -342,7 +341,6 @@ main (int argc, char *argv[])
342 int o, longindex; 341 int o, longindex;
343 int retval = 0; 342 int retval = 0;
344 343
345#ifdef HAVE_GETOPT_H
346 const struct option longopts[] = { 344 const struct option longopts[] = {
347 {"device", required_argument, 0, 'd'}, 345 {"device", required_argument, 0, 'd'},
348 {"immediate", no_argument, 0, 'i'}, 346 {"immediate", no_argument, 0, 'i'},
@@ -354,16 +352,10 @@ main (int argc, char *argv[])
354 {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 352 {"version", no_argument, 0, 'V'}, {0, 0, 0, 0}
355 }; 353 };
356 354
357#endif /* */
358 while (1) { 355 while (1) {
359 356
360#ifdef HAVE_GETOPT_H
361 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex); 357 o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
362 358
363#else /* */
364 o = getopt (argc, argv, "+d:iq10nhV");
365
366#endif /* */
367 if (o == -1 || o == EOF) 359 if (o == -1 || o == EOF)
368 break; 360 break;
369 switch (o) { 361 switch (o) {
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index ac11c58..90fe622 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -130,7 +130,6 @@ process_arguments (int argc, char **argv)
130{ 130{
131 int c; 131 int c;
132 132
133#ifdef HAVE_GETOPT_H
134 int option_index = 0; 133 int option_index = 0;
135 /* initialize the long option struct */ 134 /* initialize the long option struct */
136 static struct option longopts[] = { 135 static struct option longopts[] = {
@@ -147,7 +146,6 @@ process_arguments (int argc, char **argv)
147 {"crit", required_argument, 0, 'c'}, 146 {"crit", required_argument, 0, 'c'},
148 {0, 0, 0, 0} 147 {0, 0, 0, 0}
149 }; 148 };
150#endif
151 149
152 if (argc < 2) 150 if (argc < 2)
153 return ERROR; 151 return ERROR;
@@ -158,11 +156,7 @@ process_arguments (int argc, char **argv)
158 } 156 }
159 157
160 while (1) { 158 while (1) {
161#ifdef HAVE_GETOPT_H 159 c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
162 c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
163#else
164 c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:D:P:");
165#endif
166 160
167 if (c == -1 || c == EOF) 161 if (c == -1 || c == EOF)
168 break; 162 break;
diff --git a/plugins/check_load.c b/plugins/check_load.c
index 7d60d23..ba1a598 100644
--- a/plugins/check_load.c
+++ b/plugins/check_load.c
@@ -155,7 +155,6 @@ process_arguments (int argc, char **argv)
155{ 155{
156 int c = 0; 156 int c = 0;
157 157
158#ifdef HAVE_GETOPT_H
159 int option_index = 0; 158 int option_index = 0;
160 static struct option long_options[] = { 159 static struct option long_options[] = {
161 {"warning", required_argument, 0, 'w'}, 160 {"warning", required_argument, 0, 'w'},
@@ -164,19 +163,13 @@ process_arguments (int argc, char **argv)
164 {"help", no_argument, 0, 'h'}, 163 {"help", no_argument, 0, 'h'},
165 {0, 0, 0, 0} 164 {0, 0, 0, 0}
166 }; 165 };
167#endif
168
169#define OPTCHARS "Vhc:w:"
170 166
171 if (argc < 2) 167 if (argc < 2)
172 return ERROR; 168 return ERROR;
173 169
174 while (1) { 170 while (1) {
175#ifdef HAVE_GETOPT_H 171 c = getopt_long (argc, argv, "Vhc:w:", long_options, &option_index);
176 c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index); 172
177#else
178 c = getopt (argc, argv, OPTCHARS);
179#endif
180 if (c == -1 || c == EOF) 173 if (c == -1 || c == EOF)
181 break; 174 break;
182 175
diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index e26e2e6..095dcbc 100644
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
@@ -214,7 +214,6 @@ process_arguments (int argc, char **argv)
214{ 214{
215 int c; 215 int c;
216 216
217#ifdef HAVE_GETOPT_H
218 int option_index = 0; 217 int option_index = 0;
219 static struct option long_options[] = { 218 static struct option long_options[] = {
220 {"logfile", required_argument, 0, 'F'}, 219 {"logfile", required_argument, 0, 'F'},
@@ -230,7 +229,6 @@ process_arguments (int argc, char **argv)
230 {"help", no_argument, 0, 'h'}, 229 {"help", no_argument, 0, 'h'},
231 {0, 0, 0, 0} 230 {0, 0, 0, 0}
232 }; 231 };
233#endif
234 232
235 if (argc < 2) 233 if (argc < 2)
236 return ERROR; 234 return ERROR;
@@ -245,13 +243,8 @@ process_arguments (int argc, char **argv)
245 } 243 }
246 244
247 while (1) { 245 while (1) {
248#ifdef HAVE_GETOPT_H 246 c = getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
249 c =
250 getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
251 &option_index); 247 &option_index);
252#else
253 c = getopt (argc, argv, "hVF:e:a:v:c:w:l:u:");
254#endif
255 248
256 if (c == -1 || c == EOF) 249 if (c == -1 || c == EOF)
257 break; 250 break;
@@ -370,12 +363,7 @@ void
370print_usage (void) 363print_usage (void)
371{ 364{
372 printf ("Usage:\n" " %s %s\n" 365 printf ("Usage:\n" " %s %s\n"
373#ifdef HAVE_GETOPT_H
374 " %s (-h | --help) for detailed help\n" 366 " %s (-h | --help) for detailed help\n"
375 " %s (-V | --version) for version information\n", 367 " %s (-V | --version) for version information\n",
376#else
377 " %s -h for detailed help\n"
378 " %s -V for version information\n",
379#endif
380 progname, OPTIONS, progname, progname); 368 progname, OPTIONS, progname, progname);
381} 369}
diff --git a/plugins/check_mrtgtraf.c b/plugins/check_mrtgtraf.c
index 94e6e08..21791ae 100644
--- a/plugins/check_mrtgtraf.c
+++ b/plugins/check_mrtgtraf.c
@@ -231,7 +231,6 @@ process_arguments (int argc, char **argv)
231{ 231{
232 int c; 232 int c;
233 233
234#ifdef HAVE_GETOPT_H
235 int option_index = 0; 234 int option_index = 0;
236 static struct option longopts[] = { 235 static struct option longopts[] = {
237 {"logfile", required_argument, 0, 'F'}, 236 {"logfile", required_argument, 0, 'F'},
@@ -245,7 +244,6 @@ process_arguments (int argc, char **argv)
245 {"help", no_argument, 0, 'h'}, 244 {"help", no_argument, 0, 'h'},
246 {0, 0, 0, 0} 245 {0, 0, 0, 0}
247 }; 246 };
248#endif
249 247
250 if (argc < 2) 248 if (argc < 2)
251 return ERROR; 249 return ERROR;
@@ -260,11 +258,7 @@ process_arguments (int argc, char **argv)
260 } 258 }
261 259
262 while (1) { 260 while (1) {
263#ifdef HAVE_GETOPT_H 261 c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
264 c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
265#else
266 c = getopt (argc, argv, "hVF:e:a:c:w:");
267#endif
268 262
269 if (c == -1 || c == EOF) 263 if (c == -1 || c == EOF)
270 break; 264 break;
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c
index 18324c8..3074814 100644
--- a/plugins/check_mysql.c
+++ b/plugins/check_mysql.c
@@ -126,7 +126,6 @@ process_arguments (int argc, char **argv)
126{ 126{
127 int c; 127 int c;
128 128
129#ifdef HAVE_GETOPT_H
130 int option_index = 0; 129 int option_index = 0;
131 static struct option long_options[] = { 130 static struct option long_options[] = {
132 {"hostname", required_argument, 0, 'H'}, 131 {"hostname", required_argument, 0, 'H'},
@@ -139,18 +138,12 @@ process_arguments (int argc, char **argv)
139 {"help", no_argument, 0, 'h'}, 138 {"help", no_argument, 0, 'h'},
140 {0, 0, 0, 0} 139 {0, 0, 0, 0}
141 }; 140 };
142#endif
143 141
144 if (argc < 1) 142 if (argc < 1)
145 return ERROR; 143 return ERROR;
146 144
147 while (1) { 145 while (1) {
148#ifdef HAVE_GETOPT_H 146 c = getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
149 c =
150 getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
151#else
152 c = getopt (argc, argv, "hVP:p:u:d:H:");
153#endif
154 147
155 if (c == -1 || c == EOF) 148 if (c == -1 || c == EOF)
156 break; 149 break;
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index 5c4cd4a..649bec4 100644
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
@@ -144,7 +144,6 @@ process_arguments (int argc, char **argv)
144{ 144{
145 int c; 145 int c;
146 146
147#ifdef HAVE_GETOPT_H
148 int option_index = 0; 147 int option_index = 0;
149 static struct option long_options[] = { 148 static struct option long_options[] = {
150 {"filename", required_argument, 0, 'F'}, 149 {"filename", required_argument, 0, 'F'},
@@ -154,7 +153,6 @@ process_arguments (int argc, char **argv)
154 {"help", no_argument, 0, 'h'}, 153 {"help", no_argument, 0, 'h'},
155 {0, 0, 0, 0} 154 {0, 0, 0, 0}
156 }; 155 };
157#endif
158 156
159 if (argc < 2) 157 if (argc < 2)
160 return ERROR; 158 return ERROR;
@@ -172,11 +170,7 @@ process_arguments (int argc, char **argv)
172 } 170 }
173 171
174 while (1) { 172 while (1) {
175#ifdef HAVE_GETOPT_H
176 c = getopt_long (argc, argv, "+hVF:C:e:", long_options, &option_index); 173 c = getopt_long (argc, argv, "+hVF:C:e:", long_options, &option_index);
177#else
178 c = getopt (argc, argv, "+hVF:C:e:");
179#endif
180 174
181 if (c == -1 || c == EOF || c == 1) 175 if (c == -1 || c == EOF || c == 1)
182 break; 176 break;
diff --git a/plugins/check_nt.c b/plugins/check_nt.c
index 1c9dc0a..c7baa47 100644
--- a/plugins/check_nt.c
+++ b/plugins/check_nt.c
@@ -387,7 +387,6 @@ int main(int argc, char **argv){
387int process_arguments(int argc, char **argv){ 387int process_arguments(int argc, char **argv){
388 int c; 388 int c;
389 389
390#ifdef HAVE_GETOPT_H
391 int option_index = 0; 390 int option_index = 0;
392 static struct option long_options[] = 391 static struct option long_options[] =
393 { 392 {
@@ -401,7 +400,6 @@ int process_arguments(int argc, char **argv){
401 {"help", no_argument, 0,'h'}, 400 {"help", no_argument, 0,'h'},
402 {0,0,0,0} 401 {0,0,0,0}
403 }; 402 };
404#endif
405 403
406 /* no options were supplied */ 404 /* no options were supplied */
407 if(argc<2) return ERROR; 405 if(argc<2) return ERROR;
@@ -424,11 +422,7 @@ int process_arguments(int argc, char **argv){
424 } 422 }
425 423
426 while (1){ 424 while (1){
427#ifdef HAVE_GETOPT_H
428 c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",long_options,&option_index); 425 c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",long_options,&option_index);
429#else
430 c = getopt(argc,argv,"+hVH:t:c:w:p:v:l:s:d:");
431#endif
432 426
433 if (c==-1||c==EOF||c==1) 427 if (c==-1||c==EOF||c==1)
434 break; 428 break;
diff --git a/plugins/check_nwstat.c b/plugins/check_nwstat.c
index 2f7ecc1..100be12 100644
--- a/plugins/check_nwstat.c
+++ b/plugins/check_nwstat.c
@@ -622,7 +622,6 @@ int main(int argc, char **argv){
622int process_arguments(int argc, char **argv){ 622int process_arguments(int argc, char **argv){
623 int c; 623 int c;
624 624
625#ifdef HAVE_GETOPT_H
626 int option_index = 0; 625 int option_index = 0;
627 static struct option long_options[] = 626 static struct option long_options[] =
628 { 627 {
@@ -637,7 +636,6 @@ int process_arguments(int argc, char **argv){
637 {"help", no_argument, 0,'h'}, 636 {"help", no_argument, 0,'h'},
638 {0,0,0,0} 637 {0,0,0,0}
639 }; 638 };
640#endif
641 639
642 /* no options were supplied */ 640 /* no options were supplied */
643 if(argc<2) return ERROR; 641 if(argc<2) return ERROR;
@@ -660,11 +658,7 @@ int process_arguments(int argc, char **argv){
660 } 658 }
661 659
662 while (1){ 660 while (1){
663#ifdef HAVE_GETOPT_H
664 c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",long_options,&option_index); 661 c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",long_options,&option_index);
665#else
666 c = getopt(argc,argv,"+hoVH:t:c:w:p:v:");
667#endif
668 662
669 if (c==-1||c==EOF||c==1) 663 if (c==-1||c==EOF||c==1)
670 break; 664 break;
@@ -797,13 +791,8 @@ void print_usage(void)
797 printf 791 printf
798 ("Usage:\n" 792 ("Usage:\n"
799 " %s %s\n" 793 " %s %s\n"
800#ifdef HAVE_GETOPT_H
801 " %s (-h | --help) for detailed help\n" 794 " %s (-h | --help) for detailed help\n"
802 " %s (-V | --version) for version information\n", 795 " %s (-V | --version) for version information\n",
803#else
804 " %s -h for detailed help\n"
805 " %s -V for version information\n",
806#endif
807 progname, OPTIONS, progname, progname); 796 progname, OPTIONS, progname, progname);
808} 797}
809 798
diff --git a/plugins/check_overcr.c b/plugins/check_overcr.c
index 2ff37a4..4c3b957 100644
--- a/plugins/check_overcr.c
+++ b/plugins/check_overcr.c
@@ -317,7 +317,6 @@ process_arguments (int argc, char **argv)
317{ 317{
318 int c; 318 int c;
319 319
320#ifdef HAVE_GETOPT_H
321 int option_index = 0; 320 int option_index = 0;
322 static struct option long_options[] = { 321 static struct option long_options[] = {
323 {"port", required_argument, 0, 'p'}, 322 {"port", required_argument, 0, 'p'},
@@ -330,7 +329,6 @@ process_arguments (int argc, char **argv)
330 {"help", no_argument, 0, 'h'}, 329 {"help", no_argument, 0, 'h'},
331 {0, 0, 0, 0} 330 {0, 0, 0, 0}
332 }; 331 };
333#endif
334 332
335 /* no options were supplied */ 333 /* no options were supplied */
336 if (argc < 2) 334 if (argc < 2)
@@ -354,13 +352,8 @@ process_arguments (int argc, char **argv)
354 } 352 }
355 353
356 while (1) { 354 while (1) {
357#ifdef HAVE_GETOPT_H 355 c = getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
358 c =
359 getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
360 &option_index); 356 &option_index);
361#else
362 c = getopt (argc, argv, "+hVH:t:c:w:p:v:");
363#endif
364 357
365 if (c == -1 || c == EOF || c == 1) 358 if (c == -1 || c == EOF || c == 1)
366 break; 359 break;
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 2033b8c..e148456 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -246,7 +246,6 @@ process_arguments (int argc, char **argv)
246{ 246{
247 int c; 247 int c;
248 248
249#ifdef HAVE_GETOPT_H
250 int option_index = 0; 249 int option_index = 0;
251 static struct option long_options[] = { 250 static struct option long_options[] = {
252 {"help", no_argument, 0, 'h'}, 251 {"help", no_argument, 0, 'h'},
@@ -262,15 +261,11 @@ process_arguments (int argc, char **argv)
262 {"database", required_argument, 0, 'd'}, 261 {"database", required_argument, 0, 'd'},
263 {0, 0, 0, 0} 262 {0, 0, 0, 0}
264 }; 263 };
265#endif
266 264
267 while (1) { 265 while (1) {
268#ifdef HAVE_GETOPT_H
269 c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:", 266 c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:",
270 long_options, &option_index); 267 long_options, &option_index);
271#else 268
272 c = getopt (argc, argv, "hVt:c:w:H:P:d:l:p:a:");
273#endif
274 if (c == EOF) 269 if (c == EOF)
275 break; 270 break;
276 271
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 480f631..2526a74 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -162,7 +162,6 @@ process_arguments (int argc, char **argv)
162 int c = 1; 162 int c = 1;
163 char *ptr; 163 char *ptr;
164 164
165#ifdef HAVE_GETOPT_H
166 int option_index = 0; 165 int option_index = 0;
167 static struct option long_options[] = { 166 static struct option long_options[] = {
168 STD_LONG_OPTS, 167 STD_LONG_OPTS,
@@ -171,9 +170,6 @@ process_arguments (int argc, char **argv)
171 {"link", no_argument, 0, 'L'}, 170 {"link", no_argument, 0, 'L'},
172 {0, 0, 0, 0} 171 {0, 0, 0, 0}
173 }; 172 };
174#endif
175
176#define OPTCHARS "VvhnLt:c:w:H:p:"
177 173
178 if (argc < 2) 174 if (argc < 2)
179 return ERROR; 175 return ERROR;
@@ -186,11 +182,8 @@ process_arguments (int argc, char **argv)
186 } 182 }
187 183
188 while (1) { 184 while (1) {
189#ifdef HAVE_GETOPT_H 185 c = getopt_long (argc, argv, "VvhnLt:c:w:H:p:", long_options, &option_index);
190 c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index); 186
191#else
192 c = getopt (argc, argv, OPTCHARS);
193#endif
194 if (c == -1 || c == EOF) 187 if (c == -1 || c == EOF)
195 break; 188 break;
196 189
@@ -507,13 +500,8 @@ void
507print_usage (void) 500print_usage (void)
508{ 501{
509 printf ("Usage:\n" " %s %s\n" 502 printf ("Usage:\n" " %s %s\n"
510#ifdef HAVE_GETOPT_H
511 " %s (-h | --help) for detailed help\n" 503 " %s (-h | --help) for detailed help\n"
512 " %s (-V | --version) for version information\n", 504 " %s (-V | --version) for version information\n",
513#else
514 " %s -h for detailed help\n"
515 " %s -V for version information\n",
516#endif
517 progname, OPTIONS, progname, progname); 505 progname, OPTIONS, progname, progname);
518} 506}
519 507
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index 755ed86..ceaff95 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -268,7 +268,6 @@ process_arguments (int argc, char **argv)
268 int c = 1; 268 int c = 1;
269 char *user; 269 char *user;
270 struct passwd *pw; 270 struct passwd *pw;
271#ifdef HAVE_GETOPT_H
272 int option_index = 0; 271 int option_index = 0;
273 static struct option long_options[] = { 272 static struct option long_options[] = {
274 {"warning", required_argument, 0, 'w'}, 273 {"warning", required_argument, 0, 'w'},
@@ -283,18 +282,14 @@ process_arguments (int argc, char **argv)
283 {"verbose", no_argument, 0, 'v'}, 282 {"verbose", no_argument, 0, 'v'},
284 {0, 0, 0, 0} 283 {0, 0, 0, 0}
285 }; 284 };
286#endif
287 285
288 for (c = 1; c < argc; c++) 286 for (c = 1; c < argc; c++)
289 if (strcmp ("-to", argv[c]) == 0) 287 if (strcmp ("-to", argv[c]) == 0)
290 strcpy (argv[c], "-t"); 288 strcpy (argv[c], "-t");
291 289
292 while (1) { 290 while (1) {
293#ifdef HAVE_GETOPT_H 291 c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
294 c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index); 292
295#else
296 c = getopt (argc, argv, "Vvht:c:w:p:s:u:C:a:");
297#endif
298 if (c == -1 || c == EOF) 293 if (c == -1 || c == EOF)
299 break; 294 break;
300 295
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 0b338c2..c71f3b4 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -208,7 +208,6 @@ process_arguments (int argc, char **argv)
208{ 208{
209 int c; 209 int c;
210 210
211#ifdef HAVE_GETOPT_H
212 int option_index = 0; 211 int option_index = 0;
213 static struct option long_options[] = { 212 static struct option long_options[] = {
214 {"hostname", required_argument, 0, 'H'}, 213 {"hostname", required_argument, 0, 'H'},
@@ -224,7 +223,6 @@ process_arguments (int argc, char **argv)
224 {"help", no_argument, 0, 'h'}, 223 {"help", no_argument, 0, 'h'},
225 {0, 0, 0, 0} 224 {0, 0, 0, 0}
226 }; 225 };
227#endif
228 226
229 if (argc < 2) 227 if (argc < 2)
230 return ERROR; 228 return ERROR;
@@ -251,13 +249,8 @@ process_arguments (int argc, char **argv)
251 } 249 }
252 250
253 while (1) { 251 while (1) {
254#ifdef HAVE_GETOPT_H 252 c = getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
255 c =
256 getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
257 &option_index); 253 &option_index);
258#else
259 c = getopt (argc, argv, "+hVvH:P:F:u:p:t:r:e:");
260#endif
261 254
262 if (c == -1 || c == EOF || c == 1) 255 if (c == -1 || c == EOF || c == 1)
263 break; 256 break;
@@ -340,12 +333,7 @@ void
340print_usage (void) 333print_usage (void)
341{ 334{
342 printf ("Usage:\n" " %s %s\n" 335 printf ("Usage:\n" " %s %s\n"
343#ifdef HAVE_GETOPT_H
344 " %s (-h | --help) for detailed help\n" 336 " %s (-h | --help) for detailed help\n"
345 " %s (-V | --version) for version information\n", 337 " %s (-V | --version) for version information\n",
346#else
347 " %s -h for detailed help\n"
348 " %s -V for version information\n",
349#endif
350 progname, OPTIONS, progname, progname); 338 progname, OPTIONS, progname, progname);
351} 339}
diff --git a/plugins/check_real.c b/plugins/check_real.c
index ef3581b..6b484ea 100644
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
@@ -274,7 +274,6 @@ process_arguments (int argc, char **argv)
274{ 274{
275 int c; 275 int c;
276 276
277#ifdef HAVE_GETOPT_H
278 int option_index = 0; 277 int option_index = 0;
279 static struct option long_options[] = { 278 static struct option long_options[] = {
280 {"hostname", required_argument, 0, 'H'}, 279 {"hostname", required_argument, 0, 'H'},
@@ -290,7 +289,6 @@ process_arguments (int argc, char **argv)
290 {"help", no_argument, 0, 'h'}, 289 {"help", no_argument, 0, 'h'},
291 {0, 0, 0, 0} 290 {0, 0, 0, 0}
292 }; 291 };
293#endif
294 292
295 if (argc < 2) 293 if (argc < 2)
296 return ERROR; 294 return ERROR;
@@ -305,13 +303,8 @@ process_arguments (int argc, char **argv)
305 } 303 }
306 304
307 while (1) { 305 while (1) {
308#ifdef HAVE_GETOPT_H 306 c = getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
309 c =
310 getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
311 &option_index); 307 &option_index);
312#else
313 c = getopt (argc, argv, "+?hVI:H:e:u:p:w:c:t");
314#endif
315 308
316 if (c == -1 || c == EOF) 309 if (c == -1 || c == EOF)
317 break; 310 break;
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index f78d112..5e980bc 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -192,7 +192,6 @@ process_arguments (int argc, char **argv)
192{ 192{
193 int c; 193 int c;
194 194
195#ifdef HAVE_GETOPT_H
196 int option_index = 0; 195 int option_index = 0;
197 static struct option long_options[] = { 196 static struct option long_options[] = {
198 {"hostname", required_argument, 0, 'H'}, 197 {"hostname", required_argument, 0, 'H'},
@@ -206,7 +205,6 @@ process_arguments (int argc, char **argv)
206 {"help", no_argument, 0, 'h'}, 205 {"help", no_argument, 0, 'h'},
207 {0, 0, 0, 0} 206 {0, 0, 0, 0}
208 }; 207 };
209#endif
210 208
211 if (argc < 2) 209 if (argc < 2)
212 return ERROR; 210 return ERROR;
@@ -221,13 +219,9 @@ process_arguments (int argc, char **argv)
221 } 219 }
222 220
223 while (1) { 221 while (1) {
224#ifdef HAVE_GETOPT_H 222 c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
225 c =
226 getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
227 &option_index); 223 &option_index);
228#else 224
229 c = getopt (argc, argv, "+?hVvt:p:f:e:c:w:H:");
230#endif
231 if (c == -1 || c == EOF) 225 if (c == -1 || c == EOF)
232 break; 226 break;
233 227
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 327ef81..b943379 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -422,7 +422,6 @@ process_arguments (int argc, char **argv)
422 int c = 1; 422 int c = 1;
423 int j = 0, jj = 0, ii = 0; 423 int j = 0, jj = 0, ii = 0;
424 424
425#ifdef HAVE_GETOPT_H
426 int option_index = 0; 425 int option_index = 0;
427 static struct option long_options[] = { 426 static struct option long_options[] = {
428 STD_LONG_OPTS, 427 STD_LONG_OPTS,
@@ -447,7 +446,6 @@ process_arguments (int argc, char **argv)
447 {"privpasswd", required_argument, 0, 'X'}, 446 {"privpasswd", required_argument, 0, 'X'},
448 {0, 0, 0, 0} 447 {0, 0, 0, 0}
449 }; 448 };
450#endif
451 449
452 if (argc < 2) 450 if (argc < 2)
453 return ERROR; 451 return ERROR;
@@ -463,13 +461,8 @@ process_arguments (int argc, char **argv)
463 } 461 }
464 462
465 while (1) { 463 while (1) {
466#ifdef HAVE_GETOPT_H 464 c = getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
467 c =
468 getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
469 long_options, &option_index); 465 long_options, &option_index);
470#else
471 c = getopt (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:");
472#endif
473 466
474 if (c == -1 || c == EOF) 467 if (c == -1 || c == EOF)
475 break; 468 break;
diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c
index bd0a245..f3a351e 100644
--- a/plugins/check_ssh.c
+++ b/plugins/check_ssh.c
@@ -64,7 +64,6 @@ process_arguments (int argc, char **argv)
64 int c; 64 int c;
65 char *tmp = NULL; 65 char *tmp = NULL;
66 66
67#ifdef HAVE_GETOPT_H
68 int option_index = 0; 67 int option_index = 0;
69 static struct option long_options[] = { 68 static struct option long_options[] = {
70 {"version", no_argument, 0, 'V'}, 69 {"version", no_argument, 0, 'V'},
@@ -74,7 +73,6 @@ process_arguments (int argc, char **argv)
74 {"host", required_argument, 0, 'H'}, 73 {"host", required_argument, 0, 'H'},
75 {0, 0, 0, 0} 74 {0, 0, 0, 0}
76 }; 75 };
77#endif
78 76
79 if (argc < 2) 77 if (argc < 2)
80 return ERROR; 78 return ERROR;
@@ -84,11 +82,8 @@ process_arguments (int argc, char **argv)
84 strcpy (argv[c], "-t"); 82 strcpy (argv[c], "-t");
85 83
86 while (1) { 84 while (1) {
87#ifdef HAVE_GETOPT_H
88 c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index); 85 c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index);
89#else 86
90 c = getopt (argc, argv, "+Vhvt:H:p:");
91#endif
92 if (c == -1 || c == EOF) 87 if (c == -1 || c == EOF)
93 break; 88 break;
94 89
diff --git a/plugins/check_swap.c b/plugins/check_swap.c
index 5645779..ad5eb25 100644
--- a/plugins/check_swap.c
+++ b/plugins/check_swap.c
@@ -198,7 +198,6 @@ process_arguments (int argc, char **argv)
198 int wc = 0; /* warning counter */ 198 int wc = 0; /* warning counter */
199 int cc = 0; /* critical counter */ 199 int cc = 0; /* critical counter */
200 200
201#ifdef HAVE_GETOPT_H
202 int option_index = 0; 201 int option_index = 0;
203 static struct option long_options[] = { 202 static struct option long_options[] = {
204 {"warning", required_argument, 0, 'w'}, 203 {"warning", required_argument, 0, 'w'},
@@ -209,17 +208,12 @@ process_arguments (int argc, char **argv)
209 {"help", no_argument, 0, 'h'}, 208 {"help", no_argument, 0, 'h'},
210 {0, 0, 0, 0} 209 {0, 0, 0, 0}
211 }; 210 };
212#endif
213 211
214 if (argc < 2) 212 if (argc < 2)
215 return ERROR; 213 return ERROR;
216 214
217 while (1) { 215 while (1) {
218#ifdef HAVE_GETOPT_H
219 c = getopt_long (argc, argv, "+?Vvhac:w:", long_options, &option_index); 216 c = getopt_long (argc, argv, "+?Vvhac:w:", long_options, &option_index);
220#else
221 c = getopt (argc, argv, "+?Vvhac:w:");
222#endif
223 217
224 if (c == -1 || c == EOF) 218 if (c == -1 || c == EOF)
225 break; 219 break;
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 8a2dcc5..3461c33 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -334,7 +334,6 @@ process_arguments (int argc, char **argv)
334{ 334{
335 int c; 335 int c;
336 336
337#ifdef HAVE_GETOPT_H
338 int option_index = 0; 337 int option_index = 0;
339 static struct option long_options[] = { 338 static struct option long_options[] = {
340 {"hostname", required_argument, 0, 'H'}, 339 {"hostname", required_argument, 0, 'H'},
@@ -354,7 +353,6 @@ process_arguments (int argc, char **argv)
354 {"help", no_argument, 0, 'h'}, 353 {"help", no_argument, 0, 'h'},
355 {0, 0, 0, 0} 354 {0, 0, 0, 0}
356 }; 355 };
357#endif
358 356
359 if (argc < 2) 357 if (argc < 2)
360 usage ("No arguments found\n"); 358 usage ("No arguments found\n");
@@ -377,13 +375,8 @@ process_arguments (int argc, char **argv)
377 } 375 }
378 376
379 while (1) { 377 while (1) {
380#ifdef HAVE_GETOPT_H 378 c = getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
381 c =
382 getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
383 &option_index); 379 &option_index);
384#else
385 c = getopt (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S");
386#endif
387 380
388 if (c == -1 || c == EOF || c == 1) 381 if (c == -1 || c == EOF || c == 1)
389 break; 382 break;
diff --git a/plugins/check_time.c b/plugins/check_time.c
index e4bd26d..70bb690 100644
--- a/plugins/check_time.c
+++ b/plugins/check_time.c
@@ -158,7 +158,6 @@ process_arguments (int argc, char **argv)
158{ 158{
159 int c; 159 int c;
160 160
161#ifdef HAVE_GETOPT_H
162 int option_index = 0; 161 int option_index = 0;
163 static struct option long_options[] = { 162 static struct option long_options[] = {
164 {"hostname", required_argument, 0, 'H'}, 163 {"hostname", required_argument, 0, 'H'},
@@ -172,7 +171,6 @@ process_arguments (int argc, char **argv)
172 {"help", no_argument, 0, 'h'}, 171 {"help", no_argument, 0, 'h'},
173 {0, 0, 0, 0} 172 {0, 0, 0, 0}
174 }; 173 };
175#endif
176 174
177 if (argc < 2) 175 if (argc < 2)
178 usage ("\n"); 176 usage ("\n");
@@ -191,13 +189,8 @@ process_arguments (int argc, char **argv)
191 } 189 }
192 190
193 while (1) { 191 while (1) {
194#ifdef HAVE_GETOPT_H 192 c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
195 c =
196 getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
197 &option_index); 193 &option_index);
198#else
199 c = getopt (argc, argv, "hVH:w:c:W:C:p:t:");
200#endif
201 194
202 if (c == -1 || c == EOF) 195 if (c == -1 || c == EOF)
203 break; 196 break;
diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 4ae9c10..ac22102 100644
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
@@ -125,7 +125,6 @@ process_arguments (int argc, char **argv)
125{ 125{
126 int c; 126 int c;
127 127
128#ifdef HAVE_GETOPT_H
129 int option_index = 0; 128 int option_index = 0;
130 static struct option long_options[] = { 129 static struct option long_options[] = {
131 {"hostname", required_argument, 0, 'H'}, 130 {"hostname", required_argument, 0, 'H'},
@@ -140,7 +139,6 @@ process_arguments (int argc, char **argv)
140 {"help", no_argument, 0, 'h'}, 139 {"help", no_argument, 0, 'h'},
141 {0, 0, 0, 0} 140 {0, 0, 0, 0}
142 }; 141 };
143#endif
144 142
145 if (argc < 2) 143 if (argc < 2)
146 usage ("\n"); 144 usage ("\n");
@@ -155,11 +153,7 @@ process_arguments (int argc, char **argv)
155 } 153 }
156 154
157 while (1) { 155 while (1) {
158#ifdef HAVE_GETOPT_H 156 c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
159 c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
160#else
161 c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:");
162#endif
163 157
164 if (c == -1 || c == EOF || c == 1) 158 if (c == -1 || c == EOF || c == 1)
165 break; 159 break;
diff --git a/plugins/check_ups.c b/plugins/check_ups.c
index 4c90322..b077d31 100644
--- a/plugins/check_ups.c
+++ b/plugins/check_ups.c
@@ -434,7 +434,6 @@ process_arguments (int argc, char **argv)
434{ 434{
435 int c; 435 int c;
436 436
437#ifdef HAVE_GETOPT_H
438 int option_index = 0; 437 int option_index = 0;
439 static struct option long_options[] = { 438 static struct option long_options[] = {
440 {"hostname", required_argument, 0, 'H'}, 439 {"hostname", required_argument, 0, 'H'},
@@ -448,7 +447,6 @@ process_arguments (int argc, char **argv)
448 {"help", no_argument, 0, 'h'}, 447 {"help", no_argument, 0, 'h'},
449 {0, 0, 0, 0} 448 {0, 0, 0, 0}
450 }; 449 };
451#endif
452 450
453 if (argc < 2) 451 if (argc < 2)
454 return ERROR; 452 return ERROR;
@@ -463,13 +461,8 @@ process_arguments (int argc, char **argv)
463 } 461 }
464 462
465 while (1) { 463 while (1) {
466#ifdef HAVE_GETOPT_H 464 c = getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
467 c =
468 getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
469 &option_index); 465 &option_index);
470#else
471 c = getopt (argc, argv, "hVH:u:p:v:c:w:t:");
472#endif
473 466
474 if (c == -1 || c == EOF) 467 if (c == -1 || c == EOF)
475 break; 468 break;
diff --git a/plugins/check_users.c b/plugins/check_users.c
index 565d9e7..58e8c13 100644
--- a/plugins/check_users.c
+++ b/plugins/check_users.c
@@ -136,7 +136,6 @@ process_arguments (int argc, char **argv)
136{ 136{
137 int c; 137 int c;
138 138
139#ifdef HAVE_GETOPT_H
140 int option_index = 0; 139 int option_index = 0;
141 static struct option long_options[] = { 140 static struct option long_options[] = {
142 {"critical", required_argument, 0, 'c'}, 141 {"critical", required_argument, 0, 'c'},
@@ -145,17 +144,12 @@ process_arguments (int argc, char **argv)
145 {"help", no_argument, 0, 'h'}, 144 {"help", no_argument, 0, 'h'},
146 {0, 0, 0, 0} 145 {0, 0, 0, 0}
147 }; 146 };
148#endif
149 147
150 if (argc < 2) 148 if (argc < 2)
151 usage ("\n"); 149 usage ("\n");
152 150
153 while (1) { 151 while (1) {
154#ifdef HAVE_GETOPT_H
155 c = getopt_long (argc, argv, "+hVvc:w:", long_options, &option_index); 152 c = getopt_long (argc, argv, "+hVvc:w:", long_options, &option_index);
156#else
157 c = getopt (argc, argv, "+hVvc:w:");
158#endif
159 153
160 if (c == -1 || c == EOF || c == 1) 154 if (c == -1 || c == EOF || c == 1)
161 break; 155 break;
diff --git a/plugins/check_vsz.c b/plugins/check_vsz.c
index e6132a0..7a9acb2 100644
--- a/plugins/check_vsz.c
+++ b/plugins/check_vsz.c
@@ -140,7 +140,6 @@ process_arguments (int argc, char **argv)
140{ 140{
141 int c; 141 int c;
142 142
143#ifdef HAVE_GETOPT_H
144 int option_index = 0; 143 int option_index = 0;
145 static struct option long_options[] = { 144 static struct option long_options[] = {
146 {"help", no_argument, 0, 'h'}, 145 {"help", no_argument, 0, 'h'},
@@ -150,17 +149,13 @@ process_arguments (int argc, char **argv)
150 {"command", required_argument, 0, 'C'}, 149 {"command", required_argument, 0, 'C'},
151 {0, 0, 0, 0} 150 {0, 0, 0, 0}
152 }; 151 };
153#endif
154 152
155 if (argc < 2) 153 if (argc < 2)
156 return ERROR; 154 return ERROR;
157 155
158 while (1) { 156 while (1) {
159#ifdef HAVE_GETOPT_H
160 c = getopt_long (argc, argv, "+hVc:w:C:", long_options, &option_index); 157 c = getopt_long (argc, argv, "+hVc:w:C:", long_options, &option_index);
161#else 158
162 c = getopt (argc, argv, "+hVc:w:C:");
163#endif
164 if (c == EOF) 159 if (c == EOF)
165 break; 160 break;
166 161