m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/m4/output.c,v


From: Eric Blake
Subject: Changes to m4/m4/output.c,v
Date: Tue, 22 Aug 2006 22:36:29 +0000

CVSROOT:        /sources/m4
Module name:    m4
Changes by:     Eric Blake <ericb>      06/08/22 22:36:28

Index: m4/output.c
===================================================================
RCS file: /sources/m4/m4/m4/output.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- m4/output.c 9 Aug 2006 21:33:24 -0000       1.26
+++ m4/output.c 22 Aug 2006 22:36:28 -0000      1.27
@@ -22,19 +22,11 @@
 #  include <config.h>
 #endif
 
+#include <errno.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-
-#if HAVE_UNISTD_H
-#  include <unistd.h>
-#endif
-
-#include <errno.h>
-
-#ifndef errno
-extern int errno;
-#endif
+#include <unistd.h>
 
 #include "m4private.h"
 
@@ -56,6 +48,9 @@
 extern FILE *tmpfile ();
 #endif
 
+/* FIXME - hack until we get clean-temp gnulib module going.  */
+#undef tmpfile
+
 /* Output functions.  Most of the complexity is for handling cpp like
    sync lines.
 
@@ -206,6 +201,9 @@
       if (selected_diversion->file == NULL)
        m4_error (context, EXIT_FAILURE, errno,
                  _("cannot create temporary file for diversion"));
+      if (set_cloexec_flag (fileno (selected_diversion->file), true) != 0)
+       m4_error (context, 0, errno,
+                 _("cannot protect diversion across forks"));
 
       if (selected_diversion->used > 0)
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]