diff options
Diffstat (limited to 'mount.c')
-rw-r--r-- | mount.c | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | extern const char mtab_file[]; /* Defined in utility.c */ | 44 | extern const char mtab_file[]; /* Defined in utility.c */ |
45 | 45 | ||
46 | static const char mount_usage[] = "Usage:\tmount [flags]\n" | 46 | static const char mount_usage[] = "\tmount [flags]\n" |
47 | "\tmount [flags] device directory [-o options,more-options]\n" | 47 | "\tmount [flags] device directory [-o options,more-options]\n" |
48 | "\n" | 48 | "\n" |
49 | "Flags:\n" | 49 | "Flags:\n" |
@@ -248,8 +248,7 @@ extern int mount_main (int argc, char **argv) | |||
248 | while (i>0 && *++(*argv)) switch (**argv) { | 248 | while (i>0 && *++(*argv)) switch (**argv) { |
249 | case 'o': | 249 | case 'o': |
250 | if (--i == 0) { | 250 | if (--i == 0) { |
251 | fprintf (stderr, "%s\n", mount_usage); | 251 | goto goodbye; |
252 | exit( FALSE); | ||
253 | } | 252 | } |
254 | parse_mount_options (*(++argv), &flags, string_flags); | 253 | parse_mount_options (*(++argv), &flags, string_flags); |
255 | --i; | 254 | --i; |
@@ -260,8 +259,7 @@ extern int mount_main (int argc, char **argv) | |||
260 | break; | 259 | break; |
261 | case 't': | 260 | case 't': |
262 | if (--i == 0) { | 261 | if (--i == 0) { |
263 | fprintf (stderr, "%s\n", mount_usage); | 262 | goto goodbye; |
264 | exit( FALSE); | ||
265 | } | 263 | } |
266 | filesystemType = *(++argv); | 264 | filesystemType = *(++argv); |
267 | --i; | 265 | --i; |
@@ -284,9 +282,7 @@ extern int mount_main (int argc, char **argv) | |||
284 | case 'v': | 282 | case 'v': |
285 | case 'h': | 283 | case 'h': |
286 | case '-': | 284 | case '-': |
287 | fprintf (stderr, "%s\n", mount_usage); | 285 | goto goodbye; |
288 | exit( TRUE); | ||
289 | break; | ||
290 | } | 286 | } |
291 | } else { | 287 | } else { |
292 | if (device == NULL) | 288 | if (device == NULL) |
@@ -294,8 +290,7 @@ extern int mount_main (int argc, char **argv) | |||
294 | else if (directory == NULL) | 290 | else if (directory == NULL) |
295 | directory=*argv; | 291 | directory=*argv; |
296 | else { | 292 | else { |
297 | fprintf (stderr, "%s\n", mount_usage); | 293 | goto goodbye; |
298 | exit( TRUE); | ||
299 | } | 294 | } |
300 | } | 295 | } |
301 | i--; | 296 | i--; |
@@ -331,9 +326,11 @@ extern int mount_main (int argc, char **argv) | |||
331 | exit (mount_one (device, directory, filesystemType, | 326 | exit (mount_one (device, directory, filesystemType, |
332 | flags, string_flags, useMtab, fakeIt)); | 327 | flags, string_flags, useMtab, fakeIt)); |
333 | } else { | 328 | } else { |
334 | fprintf (stderr, "%s\n", mount_usage); | 329 | goto goodbye; |
335 | exit( FALSE); | ||
336 | } | 330 | } |
337 | } | 331 | } |
338 | exit( TRUE); | 332 | exit( TRUE); |
333 | |||
334 | goodbye: | ||
335 | usage( mount_usage); | ||
339 | } | 336 | } |