|
@@ -10,6 +10,7 @@
|
|
|
#include <unistd.h>
|
|
|
#include <sys/types.h>
|
|
|
#include <wait.h>
|
|
|
+#include <string.h>
|
|
|
#include "error.h"
|
|
|
#include "execute.h"
|
|
|
|
|
@@ -48,7 +49,11 @@ int exec_shell(char* name, char** argv){
|
|
|
//Execute commande
|
|
|
execvp(name, argv);
|
|
|
//Si on arrive ici alors erreur
|
|
|
- addperror("Impossible d'executer la commande");
|
|
|
+ char* errmsg = "Erreur dans le fichier execute.c, fonction exec_shell : Impossible d'executer la commande\n";
|
|
|
+ if(write(result, errmsg, sizeof(char) * strlen(errmsg)) == ERR){
|
|
|
+ addperror("Impossible d'écrire dans le fichier de log");
|
|
|
+ }
|
|
|
+ fprintf(stderr, "Commande introuvable\n");
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
//Pere
|