diff --git a/minishell b/minishell index 8544c33..11f87e1 100755 Binary files a/minishell and b/minishell differ diff --git a/minishell.c b/minishell.c index c1ffab9..aef8131 100644 --- a/minishell.c +++ b/minishell.c @@ -18,9 +18,9 @@ list jobs; void handler_print(int signal_num, siginfo_t *info) { if (contiens(&jobs, info->si_pid)) - { + { // pid dans la lsite des proccess en fond if (prompting) - { + { // si il n'y a pas d'execution de procces actuellement printf("\n"); } printf("[%d] --> (%d) %s\n", info->si_pid, signal_num, strsignal(signal_num)); @@ -76,6 +76,10 @@ int main(int argc, char *argv[]) { // avec un path chdir(cmd->seq[0][1]); } + if (errno) + { // si le path n'existe pas + fprintf(stderr, "ERROR: cd failed, (%d) %s\n", errno, strerror(errno)); + } continue; } else if (!strcmp(cmd->seq[0][0], "jobs")) @@ -88,7 +92,7 @@ int main(int argc, char *argv[]) if (pidFils == -1) { // si le fork échoue - fprintf(stderr, "ERROR: forking failed, %s\n", strerror(errno)); + fprintf(stderr, "ERROR: forking failed, (%d) %s\n", errno, strerror(errno)); exit(errno); }