From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.devel Subject: Re: Link failure on systems lacking mkstemp Date: Fri, 29 Aug 2014 11:30:47 +0300 Message-ID: <83k35ritoo.fsf@gnu.org> References: <83ha1cek3l.fsf@gnu.org> <8361hsebh5.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1409301072 31793 80.91.229.3 (29 Aug 2014 08:31:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Aug 2014 08:31:12 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Aug 29 10:31:05 2014 Return-path: Envelope-to: guile-devel@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 1XNHaJ-0000cT-4q for guile-devel@m.gmane.org; Fri, 29 Aug 2014 10:31:03 +0200 Original-Received: from localhost ([::1]:40654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNHaI-00043E-GX for guile-devel@m.gmane.org; Fri, 29 Aug 2014 04:31:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNHaA-00042v-R0 for guile-devel@gnu.org; Fri, 29 Aug 2014 04:31:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNHa4-0004ug-U2 for guile-devel@gnu.org; Fri, 29 Aug 2014 04:30:54 -0400 Original-Received: from mtaout26.012.net.il ([80.179.55.182]:50468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNHa4-0004uK-MF for guile-devel@gnu.org; Fri, 29 Aug 2014 04:30:48 -0400 Original-Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NB200E006WBT800@mtaout26.012.net.il> for guile-devel@gnu.org; Fri, 29 Aug 2014 11:29:00 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NB200FOM7KB0P20@mtaout26.012.net.il> for guile-devel@gnu.org; Fri, 29 Aug 2014 11:29:00 +0300 (IDT) In-reply-to: <8361hsebh5.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.182 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17375 Archived-At: Ping! > Date: Sat, 16 Aug 2014 17:49:10 +0300 > From: Eli Zaretskii > > > Date: Sat, 16 Aug 2014 14:42:54 +0300 > > From: Eli Zaretskii > > > > I think the solution is simply remove mkstemp.c from libguile/, and > > all its traces from the configury that causes its dependency to be > > added to libguile/Makefile. Not sure how to do the latter, though. > > Actually, there's one small change that's required for using Gnulib's > mkstemp: it opens the temporary file in the (default) text I/O mode, > while we need it in binary mode, because we use these temporary files > for writing *.go files. Here's the proposed patch: > > +++ libguile/filesys.c 2014-08-16 17:44:35.578125000 +0300 > @@ -1479,6 +1479,14 @@ SCM_DEFINE (scm_mkstemp, "mkstemp!", 1, > SCM_SYSCALL (rv = mkstemp (c_tmpl)); > if (rv == -1) > SCM_SYSERROR; > +#ifdef __MINGW32__ > + /* Files created by this function are used for *.go files, so make > + sure they use binary I/O, or else the produced *.go files will be > + corrupted by end-of-line conversion and ^Z "software EOF" > + misfeature. Gnulib's 'mkstemp' uses the default text mode to > + open the file . */ > + _setmode (rv, _O_BINARY); > +#endif > > scm_substring_move_x (scm_from_locale_string (c_tmpl), > SCM_INUM0, scm_string_length (tmpl), > >