Quellcode durchsuchen

Modif semaphore

Loquicom vor 6 Jahren
Ursprung
Commit
3179c6bc7a
3 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 1 1
      makefile
  2. 1 1
      mysh.c
  3. 2 2
      sem.c

+ 1 - 1
makefile

@@ -101,4 +101,4 @@ command.o: command.c error.h str.h parser.h constante.h mysh.h execute.h \
 execute.o: execute.c error.h execute.h constante.h
 sem.o: sem.c error.h sem.h constante.h
 mysh.o: mysh.c error.h str.h parser.h constante.h command.h execute.h \
- mysh.h
+ mysh.h sem.h

+ 1 - 1
mysh.c

@@ -140,7 +140,7 @@ int get_tmp_file(){
 }
 
 /* --- Main --- */
-int main(int argc, char* argv[]) { 
+int main(int argc, char* argv[]) {
     //Declaration variables
     CommandTab ct;
     int result;

+ 2 - 2
sem.c

@@ -16,8 +16,8 @@ boolean create_sem(semaphore* sem, int code, int nb) {
     if (id == ERR) {
         /* Si le tableau existe deja */
         if (errno == EEXIST) {
-            adderror("Le tableau de sémaphore existe deja, tentaive de récupération");
-            return get_sem(sem, code);
+            adderror("Le tableau de sémaphore existe deja");
+            return false;
         }
         /* Sinon erreur */
         addperror("Impossible de créer le tableau de sémaphore");