--- ./subprocess.h 2021-09-01 09:13:02.281000000 +0200 +++ ./subprocess.perror.h 2021-09-01 09:30:28.898000000 +0200 @@ -752,17 +752,45 @@ #pragma clang diagnostic ignored "-Wold-style-cast" #endif - if (environment) { - exit(execve(commandLine[0], (char *const *)commandLine, - (char *const *)environment)); - } else if (subprocess_option_inherit_environment != - (options & subprocess_option_inherit_environment)) { - char *const empty_environment[1] = {SUBPROCESS_NULL}; - exit(execve(commandLine[0], (char *const *)commandLine, - empty_environment)); - } else { - exit(execv(commandLine[0], (char *const *)commandLine)); - } + //Added perror to have some output in case the system does not find + //the given command or the user gave an invalid/unknown one! + if( environment ) + { + const int e = execve( commandLine[0], + (char* const*)commandLine, + (char* const*)environment ); + if( -1 == e ) + { + perror( commandLine[0] ); + } + + exit( e ); + } + else if( subprocess_option_inherit_environment + != (options & subprocess_option_inherit_environment) ) + { + char *const empty_environment[1] = { SUBPROCESS_NULL }; + const int e = execve( commandLine[0], + (char* const*)commandLine, + empty_environment ); + if( -1 == e ) + { + perror( commandLine[0] ); + } + + exit( e ); + } + else + { + const int e = execv( commandLine[0], (char* const*)commandLine ); + + if( -1 == e ) + { + perror( commandLine[0] ); + } + + exit( e ); + } #ifdef __clang__ #pragma clang diagnostic pop