gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / tests / test-perror2.c
index 3aab640..197870d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of perror() function.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,8 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -116,12 +115,14 @@ main (void)
   /* Test that perror reports write failure.  */
   {
     ASSERT (freopen (BASE ".tmp", "r", stderr) == stderr);
-    ASSERT (setvbuf (stderr, NULL, _IOLBF, BUFSIZ) == 0);
+    ASSERT (setvbuf (stderr, NULL, _IONBF, BUFSIZ) == 0);
     errno = -1;
     ASSERT (!ferror (stderr));
     perror (NULL);
-    ASSERT (errno > 0);
 #if 0
+    /* Commented out until cygwin behaves:
+       http://sourceware.org/ml/newlib/2011/msg00228.html */
+    ASSERT (errno > 0);
     /* Commented out until glibc behaves:
        http://sourceware.org/bugzilla/show_bug.cgi?id=12792 */
     ASSERT (ferror (stderr));