NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / tests / test-ttyname_r.c
index a200ee4..c207cfb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ttyname_r(3).
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 2010-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
@@ -55,7 +55,9 @@ main (void)
            );
   }
   {
-    int err = ttyname_r (99, buf, sizeof (buf));
+    int err;
+    close (99);
+    err = ttyname_r (99, buf, sizeof (buf));
     ASSERT (err == EBADF
             || err == ENOTTY /* seen on FreeBSD 6.4 */
            );