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: Mon, 15 Sep 2014 20:15:02 +0300 Message-ID: <831trc6c15.fsf@gnu.org> References: <83ha1cek3l.fsf@gnu.org> <8361hsebh5.fsf@gnu.org> <83k35ritoo.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1410801342 19071 80.91.229.3 (15 Sep 2014 17:15:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Sep 2014 17:15:42 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Sep 15 19:15:35 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 1XTZs9-0005sS-Rk for guile-devel@m.gmane.org; Mon, 15 Sep 2014 19:15:29 +0200 Original-Received: from localhost ([::1]:33111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTZs9-0004Ix-9V for guile-devel@m.gmane.org; Mon, 15 Sep 2014 13:15:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTZry-0004Hi-71 for guile-devel@gnu.org; Mon, 15 Sep 2014 13:15:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTZro-0000w3-VC for guile-devel@gnu.org; Mon, 15 Sep 2014 13:15:18 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:53665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTZro-0000vf-Nd for guile-devel@gnu.org; Mon, 15 Sep 2014 13:15:08 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NBY00100CIQ3Q00@mtaout25.012.net.il> for guile-devel@gnu.org; Mon, 15 Sep 2014 20:09:49 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NBY00L0TD0DZW60@mtaout25.012.net.il> for guile-devel@gnu.org; Mon, 15 Sep 2014 20:09:49 +0300 (IDT) In-reply-to: <83k35ritoo.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.181 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:17448 Archived-At: Ping! (1 month) > Date: Fri, 29 Aug 2014 11:30:47 +0300 > From: Eli Zaretskii > > 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), > > > > > >