strstr: Update cross-compilation guess.
[pspp] / lib / strerror.c
index 8c411799a0b41e16265feaf76d25c78727348da5..63899ca6b264e55bb6e8ab6b5614f5293361a341 100644 (file)
@@ -45,10 +45,13 @@ strerror (int n)
   if (msg)
     return (char *) msg;
 
+  msg = strerror (n);
+
   /* Our strerror_r implementation might use the system's strerror
      buffer, so all other clients of strerror have to see the error
-     copied into a buffer that we manage.  */
-  msg = strerror (n);
+     copied into a buffer that we manage.  This is not thread-safe,
+     even if the system strerror is, but portable programs shouldn't
+     be using strerror if they care about thread-safety.  */
   if (!msg || !*msg)
     {
       static char const fmt[] = "Unknown error %d";