print correct command with perror
This commit is contained in:
@@ -11,11 +11,11 @@ int s_do(char **args) {
|
|||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
if (execvp(args[0], args) == -1) perror("lsh");
|
if (execvp(args[0], args) == -1) perror(args[0]);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
} else if (pid < 0) {
|
} else if (pid < 0) {
|
||||||
// Error forking
|
// Error forking
|
||||||
perror("lsh");
|
perror(args[0]);
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
wpid = waitpid(pid, &s, WUNTRACED);
|
wpid = waitpid(pid, &s, WUNTRACED);
|
||||||
|
Reference in New Issue
Block a user