Commit 091f8f50299b1a2ac74c453a0ca037dc6c5eac8e
1 parent
e368f773
Don't require sudo to get help...
Showing
1 changed file
with
12 additions
and
11 deletions
main.c
| @@ -163,17 +163,6 @@ int ep_read(void *buf, int len, libusb_device_handle * usb_device) | @@ -163,17 +163,6 @@ int ep_read(void *buf, int len, libusb_device_handle * usb_device) | ||
| 163 | 163 | ||
| 164 | void get_options(int argc, char *argv[]) | 164 | void get_options(int argc, char *argv[]) |
| 165 | { | 165 | { |
| 166 | -#if defined (__CYGWIN__) | ||
| 167 | - //printf("Running under Cygwin\n"); | ||
| 168 | -#else | ||
| 169 | - //exit if not run as sudo | ||
| 170 | - if(getuid() != 0) | ||
| 171 | - { | ||
| 172 | - printf("Must be run with sudo...\n"); | ||
| 173 | - exit(-1); | ||
| 174 | - } | ||
| 175 | -#endif | ||
| 176 | - | ||
| 177 | // Skip the command name | 166 | // Skip the command name |
| 178 | argv++; argc--; | 167 | argv++; argc--; |
| 179 | while(*argv) | 168 | while(*argv) |
| @@ -417,6 +406,18 @@ int main(int argc, char *argv[]) | @@ -417,6 +406,18 @@ int main(int argc, char *argv[]) | ||
| 417 | 406 | ||
| 418 | get_options(argc, argv); | 407 | get_options(argc, argv); |
| 419 | 408 | ||
| 409 | +#if defined (__CYGWIN__) | ||
| 410 | + //printf("Running under Cygwin\n"); | ||
| 411 | +#else | ||
| 412 | + //exit if not run as sudo | ||
| 413 | + if(getuid() != 0) | ||
| 414 | + { | ||
| 415 | + printf("Must be run with sudo...\n"); | ||
| 416 | + exit(-1); | ||
| 417 | + } | ||
| 418 | +#endif | ||
| 419 | + | ||
| 420 | + | ||
| 420 | // Default to standard msd directory | 421 | // Default to standard msd directory |
| 421 | if(directory == NULL) | 422 | if(directory == NULL) |
| 422 | directory = "msd"; | 423 | directory = "msd"; |