unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 14803@debbugs.gnu.org
Subject: bug#14803: Setting close-on-exec flag consistently
Date: Sun, 07 Jul 2013 05:46:27 +0300	[thread overview]
Message-ID: <83zjtzw0ho.fsf@gnu.org> (raw)
In-Reply-To: <51D88F7E.3080502@cs.ucla.edu>

> Date: Sat, 06 Jul 2013 14:43:26 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: 14803@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@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.





  reply	other threads:[~2013-07-07  2:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-06  9:13 bug#14803: Setting close-on-exec flag consistently Paul Eggert
2013-07-06 11:31 ` Eli Zaretskii
2013-07-06 17:18   ` Paul Eggert
2013-07-06 17:54     ` Eli Zaretskii
2013-07-06 21:43       ` Paul Eggert
2013-07-07  2:46         ` Eli Zaretskii [this message]
2013-07-07  6:34           ` Paul Eggert
2013-07-07 16:45             ` Eli Zaretskii
2013-07-07 18:01               ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zjtzw0ho.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=14803@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).