Changeset 133 in flair-src for trunk/lib/FlairCore/src/Semaphore_impl.cpp


Ignore:
Timestamp:
02/09/17 11:08:31 (5 years ago)
Author:
Sanahuja Guillaume
Message:

modif sterror

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Semaphore_impl.cpp

    r126 r133  
    2828  this->self = self;
    2929  int status;
     30        char errorMsg[256];
     31       
    3032#ifdef __XENO__
    3133  status = rt_sem_create(&semaphore, NULL, initialValue, S_FIFO);
     
    3436#endif
    3537  if (status != 0) {
    36     self->Err("error creating semaphore (%s)\n", strerror(-status));
     38    self->Err("error creating semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    3739  }
    3840}
     
    4042Semaphore_impl::~Semaphore_impl() {
    4143  int status;
     44        char errorMsg[256];
     45       
    4246#ifdef __XENO__
    4347  status = rt_sem_delete(&semaphore);
     
    4650#endif
    4751  if (status != 0)
    48     self->Err("error destroying semaphore (%s)\n", strerror(-status));
     52    self->Err("error destroying semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    4953}
    5054
     
    7377                        self->Warn("warning : semaphore timedout\n");   
    7478                } else {
    75                     self->Err("error getting the semaphore (%s)\n", strerror(-status));
     79                                        char errorMsg[256];
     80                    self->Err("error getting the semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    7681                }
    7782    returnValue = false;
     
    8994#endif
    9095  if (status != 0) {
    91     self->Err("error releasing the semaphore (%s)\n", strerror(-status));
     96                char errorMsg[256];
     97    self->Err("error releasing the semaphore (%s)\n", strerror_r(-status, errorMsg, sizeof(errorMsg)));
    9298    returnValue = false;
    9399  }
Note: See TracChangeset for help on using the changeset viewer.