ywkaras opened a new issue, #9073:
URL: https://github.com/apache/trafficserver/issues/9073

   Not working on Ubuntu:
   ```
   wkaras ~/STRERR
   $ cat x.cc
   #include <string.h>
   
   #include <iostream>
   
   bool
   _success(int retval)
   {
     return retval == 0;
   }
   
   bool
   _success(char *retval)
   {
     return retval != nullptr;
   }
   
   void test(int err_num)
   {
     char buf[256];
     char const *out;
   
     // Handle either GNU or XSI version of strerror_r().
     //
     if (!_success(strerror_r(err_num, buf, 256))) {
       out = "strerror_r() call failed";
     } else {
       buf[255] = '\0';
       out      = buf;
     }
   
     std::cout << "len=" << strlen(out) << '\n';
     std::cout << '"' << out << '"' << '\n';
   }
   
   int main()
   {
     test(1);
     test(98);
   
     return 0;
   }
   wkaras ~/STRERR
   $ gcc -Wall -Wextra -pedantic x.cc -lstdc++
   wkaras ~/STRERR
   $ ./a.out
   len=1
   ""
   len=1
   ""
   wkaras ~/STRERR
   $ gcc --version
   gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
   Copyright (C) 2019 Free Software Foundation, Inc.
   This is free software; see the source for copying conditions.  There is NO
   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   
   wkaras ~/STRERR
   $ cat /etc/lsb-release 
   DISTRIB_ID=Ubuntu
   DISTRIB_RELEASE=20.04
   DISTRIB_CODENAME=focal
   DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
   wkaras ~/STRERR
   $ 
   ```
   Also fails on RHEL 7.9 with GCC 8.3.1.
   
   strerror_r() is used in include/ts/util/Strerror.h .
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to