NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / tests / test-freopen.c
index cac907c..a98530c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file stream.
-   Copyright (C) 2007-2011 Free Software Foundation, Inc.
+   Copyright (C) 2007-2014 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
@@ -62,7 +62,9 @@ main ()
       }
   }
   {
-    FILE *fp = fdopen (99, "w+");
+    FILE *fp;
+    close (99);
+    fp = fdopen (99, "w+");
     if (fp != NULL)
       {
         errno = 0;