print correct command with perror
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user