GNU bug report logs - #14803
Setting close-on-exec flag consistently

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Sat, 6 Jul 2013 09:14:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 14803 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 14803 <at> debbugs.gnu.org
Subject: Re: bug#14803: Setting close-on-exec flag consistently
Date: Sun, 07 Jul 2013 05:46:27 +0300
> Date: Sat, 06 Jul 2013 14:43:26 -0700
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> CC: 14803 <at> debbugs.gnu.org
> 
> > I assume that lib/fcntl.c and
> > lib/pipe2.c will not be compiled for w32, due to some configure test?
> 
> Yes, though that needs to be arranged.  The following further
> patch should do it:
> 
> === modified file 'ChangeLog'
> --- ChangeLog	2013-07-06 09:44:23 +0000
> +++ ChangeLog	2013-07-06 21:39:31 +0000
> @@ -1,7 +1,9 @@
>  2013-07-06  Paul Eggert  <eggert <at> cs.ucla.edu>
>  
>  	Make file descriptors close-on-exec when possible (Bug#14803).
> -	* configure.ac (mkostemp): New function to check for.
> +	* configure.ac (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
> +	(gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): Hotwire for MinGW.
> +	(mkostemp): New function to check for.
>  	(PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
>  	* lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
>  	* m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
> 
> === modified file 'configure.ac'
> --- configure.ac	2013-07-06 07:04:07 +0000
> +++ configure.ac	2013-07-06 21:33:56 +0000
> @@ -634,6 +634,19 @@
>  # Avoid gnulib's threadlib module, as we do threads our own way.
>  AC_DEFUN([gl_THREADLIB])
>  
> +# On MinGW, Emacs supplies its own substitutes for some missing functions,
> +# so hotwire the cache to pretend to Gnulib that the functions work;
> +# that way, 'configure' won't arrange to build the Gnulib substitutes.
> +if test "$opsys" = mingw32; then
> +  # fcntl
> +  ac_cv_func_fcntl=emulated # Any single word other than 'no' will do.
> +  gl_cv_func_fcntl_f_dupfd_cloexec=yes # Actually 'no', but only 'yes' works.
> +  gl_cv_func_fcntl_f_dupfd_works='no, but Emacs emulates yes'
> +
> +  # pipe2
> +  ac_cv_func_pipe2='no, but Emacs emulates yes'
> +fi
> +

This should probably go into nt/mingw-cfg.site.

Thanks.




This bug report was last modified 12 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.