client: return a possible error code to the core client if execv fails for some reason in the switcher tool.

This commit is contained in:
Rom Walton 2014-07-24 00:31:57 -04:00
parent 55a17c3b41
commit f014b0d6da
1 changed files with 7 additions and 3 deletions

View File

@ -130,9 +130,13 @@ int main(int /*argc*/, char** argv) {
#endif
}
execv(argv[1], argv+2);
retval = execv(argv[1], argv+2);
if (retval == -1) {
retval = errno;
// If we got here execv failed
fprintf(stderr, "Process creation (%s) failed: errno=%d\n", argv[1], errno);
// If we got here execv failed
fprintf(stderr, "Process creation (%s) failed: %s (errno = %d)\n", argv[1], strerror(retval), retval);
}
return retval;
}