diff --git a/VERSION b/VERSION index e49aa3c4..8fc1e686 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-173-g9886316e07+1 \ No newline at end of file +a12-174-g86c7286aad+1 \ No newline at end of file diff --git a/c-host/platform/Linux/src/platform.c b/c-host/platform/Linux/src/platform.c index 14607978..397a7f39 100644 --- a/c-host/platform/Linux/src/platform.c +++ b/c-host/platform/Linux/src/platform.c @@ -121,19 +121,19 @@ static int shmOpenDev(const char * shmDevice) return fd; } -static bool shmDeviceValidator(struct OptionValue * value) +static bool shmDeviceValidator(struct OptionValue * value, const char ** error) { char * name = uioGetName(value->v.x_string); if (!name) { - printf("Failed to get the uio device name for: %s\n", value->v.x_string); + *error = "Failed to get the uio device name"; return false; } if (strcmp(name, "KVMFR") != 0) { free(name); - printf("Device is not a KVMFR device \"%s\" reports as: %s\n", value->v.x_string, name); + *error = "Device is not a KVMFR device"; return false; } @@ -143,7 +143,7 @@ static bool shmDeviceValidator(struct OptionValue * value) static void shmDevicePrintHelp() { - printf("Valid devices are:\n"); + printf("Valid devices are:\n\n"); DIR * d = opendir("/sys/class/uio"); if (!d) return; @@ -159,7 +159,7 @@ static void shmDevicePrintHelp() continue; if (strcmp(name, "KVMFR") == 0) - printf(" %s\n", dir->d_name); + printf(" * %s\n", dir->d_name); free(name); } diff --git a/c-host/src/app.c b/c-host/src/app.c index f0a6586b..6f2b0cc9 100644 --- a/c-host/src/app.c +++ b/c-host/src/app.c @@ -276,6 +276,12 @@ int app_main(int argc, char * argv[]) return -1; } + if (!option_validate()) + { + option_free(); + return -1; + } + // perform platform specific initialization if (!app_init()) return -1;