Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / gnulib-lib / clean-temp.c
index 40ec02f..d388464 100644 (file)
@@ -1,5 +1,5 @@
 /* Temporary directories and temporary files with automatic cleanup.
-   Copyright (C) 2001, 2003, 2006-2007, 2009-2013 Free Software Foundation,
+   Copyright (C) 2001, 2003, 2006-2007, 2009-2015 Free Software Foundation,
    Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
 # define uintptr_t unsigned long
 #endif
 
-#if !GNULIB_FCNTL_SAFER
-/* The results of open() in this file are not used with fchdir,
-   therefore save some unnecessary work in fchdir.c.  */
-# undef open
-# undef close
-#endif
-
 
 /* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5))
    ensure that while constructing or modifying the data structures, the field
@@ -582,6 +575,9 @@ static bool
 supports_delete_on_close ()
 {
   static int known; /* 1 = yes, -1 = no, 0 = unknown */
+  /* M4 wants to close and later reopen a temporary file, so
+     delete-on-close must not be used.  */
+  known = -1;
   if (!known)
     {
       OSVERSIONINFO v;