Don't require sudo to get help...

This commit is contained in:
Gordon Hollingworth 2017-01-20 11:19:40 +00:00
parent e368f77398
commit 091f8f5029

23
main.c
View File

@ -163,17 +163,6 @@ int ep_read(void *buf, int len, libusb_device_handle * usb_device)
void get_options(int argc, char *argv[])
{
#if defined (__CYGWIN__)
//printf("Running under Cygwin\n");
#else
//exit if not run as sudo
if(getuid() != 0)
{
printf("Must be run with sudo...\n");
exit(-1);
}
#endif
// Skip the command name
argv++; argc--;
while(*argv)
@ -417,6 +406,18 @@ int main(int argc, char *argv[])
get_options(argc, argv);
#if defined (__CYGWIN__)
//printf("Running under Cygwin\n");
#else
//exit if not run as sudo
if(getuid() != 0)
{
printf("Must be run with sudo...\n");
exit(-1);
}
#endif
// Default to standard msd directory
if(directory == NULL)
directory = "msd";