Преглед изворни кода

Fix: POSIX GetErrorMessage() became broken when _GNU_SOURCE was defined

The commit 070fe495552984bda4a59e82be591b99d9fdf1fa replaced some illegal
compile defines with _GNU_SOURCE. But this in turn broke the
GetErrorMessage() function because the GNU version of strerror_r() does
NOT ALWAYS write the message in the supplied buffer.

To work correctly we need to use the XSI compliant strerror_r() version
which is achieved by un-defining _GNU_SOURCE.

Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Stefan Mätje пре 6 година
родитељ
комит
58a2fd7b22
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      source/src/ports/POSIX/opener_error.c

+ 2 - 0
source/src/ports/POSIX/opener_error.c

@@ -10,6 +10,8 @@
  *
  */
 
+#undef _GNU_SOURCE  /* Force the use of the XSI compliant strerror_r() function. */
+
 #include <errno.h>
 #include <stddef.h>
 #include <stdlib.h>