diff --git a/client/switcher.cpp b/client/switcher.cpp index 7bc1aa84f0..3200ed62dc 100644 --- a/client/switcher.cpp +++ b/client/switcher.cpp @@ -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; }