print correct command with perror

This commit is contained in:
2017-08-28 09:57:40 +02:00
parent 01512003fe
commit 66dd178c7e

View File

@@ -11,11 +11,11 @@ int s_do(char **args) {
pid = fork();
if (!pid) {
if (execvp(args[0], args) == -1) perror("lsh");
if (execvp(args[0], args) == -1) perror(args[0]);
exit(EXIT_FAILURE);
} else if (pid < 0) {
// Error forking
perror("lsh");
perror(args[0]);
} else {
do {
wpid = waitpid(pid, &s, WUNTRACED);