Ignore:
Timestamp:
Feb 9, 2017, 11:08:31 AM (5 years ago)
Author:
Sanahuja Guillaume
Message:

modif sterror

File:
1 edited

Legend:

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

    r15 r133  
    2121
    2222#include <rtdm/rtserial.h>
    23 #include <errno.h>
    2423#include <cstring>
    2524
     
    4140      fd = rt_dev_open(device.c_str(), 0);
    4241  if (fd < 0) {
    43     Err("erreur rt_dev_open (%s)\n", strerror(-fd));
     42                char errorMsg[256];
     43    Err("error rt_dev_open (%s)\n", strerror_r(-fd, errorMsg, sizeof(errorMsg)));
    4444  }
    4545
     
    4747  int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
    4848  if (err) {
    49     Err("erreur rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror(-err));
     49                char errorMsg[256];
     50    Err("error rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
    5051  }
    5152}
     
    6364  int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
    6465  if (err) {
    65     Err("erreur rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror(-err));
     66                char errorMsg[256];
     67    Err("error rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
    6668  }
    6769}
     
    7779  int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config);
    7880  if (err) {
    79     Err("erreur rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror(-err));
     81                char errorMsg[256];
     82    Err("error rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n", strerror_r(-err, errorMsg, sizeof(errorMsg)));
    8083  }
    8184}
Note: See TracChangeset for help on using the changeset viewer.