From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14803: Setting close-on-exec flag consistently Date: Sun, 07 Jul 2013 05:46:27 +0300 Message-ID: <83zjtzw0ho.fsf@gnu.org> References: <51D7DFAF.3030500@cs.ucla.edu> <83obafylf1.fsf@gnu.org> <51D8514F.8090307@cs.ucla.edu> <834nc7y3o2.fsf@gnu.org> <51D88F7E.3080502@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1373165228 21201 80.91.229.3 (7 Jul 2013 02:47:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Jul 2013 02:47:08 +0000 (UTC) Cc: 14803@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 07 04:47:09 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uvf0G-0007iQ-BN for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Jul 2013 04:47:08 +0200 Original-Received: from localhost ([::1]:57391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvf0F-0006qr-L8 for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jul 2013 22:47:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvf0C-0006qa-BR for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2013 22:47:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uvf0B-0001rr-8q for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2013 22:47:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uvf0B-0001rf-5X for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2013 22:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Uvf0A-0001SH-Co for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2013 22:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jul 2013 02:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14803 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 14803-submit@debbugs.gnu.org id=B14803.13731651995551 (code B ref 14803); Sun, 07 Jul 2013 02:47:02 +0000 Original-Received: (at 14803) by debbugs.gnu.org; 7 Jul 2013 02:46:39 +0000 Original-Received: from localhost ([127.0.0.1]:35909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uvezm-0001RQ-Od for submit@debbugs.gnu.org; Sat, 06 Jul 2013 22:46:39 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:33541) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uvezj-0001R4-Fz for 14803@debbugs.gnu.org; Sat, 06 Jul 2013 22:46:37 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MPJ00200OTS8700@a-mtaout22.012.net.il> for 14803@debbugs.gnu.org; Sun, 07 Jul 2013 05:46:28 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MPJ00154P1FV1C0@a-mtaout22.012.net.il>; Sun, 07 Jul 2013 05:46:28 +0300 (IDT) In-reply-to: <51D88F7E.3080502@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76031 Archived-At: > Date: Sat, 06 Jul 2013 14:43:26 -0700 > From: Paul Eggert > 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 > > 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.