|
@@ -17,19 +17,18 @@
|
|
|
#include "error.h"
|
|
|
#include "str.h"
|
|
|
#include "parser.h"
|
|
|
-#include "command.h"
|
|
|
-#include "execute.h"
|
|
|
-#include "ipc.h"
|
|
|
#include "mysh.h"
|
|
|
+#include "ipc.h"
|
|
|
+#include "execute.h"
|
|
|
|
|
|
/* --- Extern --- */
|
|
|
extern Error error;
|
|
|
extern boolean exitsh;
|
|
|
extern pid_t active;
|
|
|
-int status_cmd = -1;
|
|
|
-int result_cmd = -1;
|
|
|
-char base_path[BUFFER_SIZE];
|
|
|
-pid_list pidlist;
|
|
|
+extern int status_cmd;
|
|
|
+extern int result_cmd;
|
|
|
+extern char base_path[];
|
|
|
+extern pid_list pidlist;
|
|
|
|
|
|
/* --- Globale --- */
|
|
|
int job = 1;
|
|
@@ -82,7 +81,7 @@ int main(int argc, char* argv[], char* envp[]) {
|
|
|
error_init();
|
|
|
ini_pid_list(&pidlist);
|
|
|
//Recup chemain de base de l'application
|
|
|
- if (getcwd(base_path, sizeof (base_path)) == NULL) {
|
|
|
+ if (getcwd(base_path, sizeof (char) * BUFFER_SIZE) == NULL) {
|
|
|
addperror("Impossible de récuperer le chemin actuel");
|
|
|
error.print("Erreur pendant l'initialisation\n");
|
|
|
clean_pid(&pidlist);
|