src/worker.cc
// Work around the sad fact that there are two (gnu, xsi) incompatible
// versions of strerror_r floating around google. Awesome.
Work around the sad fact that there are two (gnu, xsi) incompatible
versions of strerror_r floating around google. Awesome.
Work around the sad fact that there are two ( gnu xsi ) incompatible versions of strerror_r floating around google . Awesome .
bool sat_strerror(int err, char *buf, int len) {
    buf[0] = 0;
    char *errmsg = reinterpret_cast<char*>(strerror_r(err, buf, len));
    int retval = reinterpret_cast<int64>(errmsg);
    if (retval == 0)
      return true;
    if (retval == -1)
      return false;
    if (errmsg != buf) {
      strncpy(buf, errmsg, len);
      buf[len - 1] = 0;
    }
    return true;
  }
bool sat_strerror ( int err , char * buf , int len ) { buf [ 0 ] = 0 ; char * errmsg = reinterpret_cast < char * > ( strerror_r ( err , buf , len ) ) ; int retval = reinterpret_cast < int64 > ( errmsg ) ; if ( retval == 0 ) return true ; if ( retval == -1 ) return false ; if ( errmsg != buf ) { strncpy ( buf , errmsg , len ) ; buf [ len - 1 ] = 0 ; } return true ; }
Work around the sad fact that there are two (gnu, xsi) incompatible
versions of strerror_r floating around google.
Work around the sad fact that there are two ( gnu xsi ) incompatible versions of strerror_r floating around google .