From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: gethostname errno Date: Sat, 20 Mar 2004 08:12:30 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <877jxgh4fl.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1079734520 10740 80.91.224.253 (19 Mar 2004 22:15:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Mar 2004 22:15:20 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 19 23:15:12 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B4SGl-00074z-00 for ; Fri, 19 Mar 2004 23:15:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B4SF2-000179-9X for guile-devel@m.gmane.org; Fri, 19 Mar 2004 17:13:24 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B4SEt-00016H-R9 for guile-devel@gnu.org; Fri, 19 Mar 2004 17:13:15 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B4SEQ-00010P-SE for guile-devel@gnu.org; Fri, 19 Mar 2004 17:13:14 -0500 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B4SEQ-0000zp-6m for guile-devel@gnu.org; Fri, 19 Mar 2004 17:12:46 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i2JMCe5v018972 for ; Sat, 20 Mar 2004 09:12:40 +1100 Original-Received: from localhost (ppp220.dyn11.pacific.net.au [61.8.11.220]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i2JMCdbq006344 for ; Sat, 20 Mar 2004 09:12:40 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1B4SEA-0000eM-00; Sat, 20 Mar 2004 08:12:30 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 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 Xref: main.gmane.org gmane.lisp.guile.devel:3529 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3529 --=-=-= * posix.c (scm_gethostname): Preserve errno across free() call. Though I don't suppose gethostname ever reports an error, not with the way the buffer size is increased automatically. This will be for the 1.6 branch too I think. --=-=-= Content-Disposition: inline; filename=posix.c.gethostname-errno.diff --- posix.c.~1.126.~ 2004-02-29 09:22:52.000000000 +1000 +++ posix.c 2004-03-18 14:02:04.000000000 +1000 @@ -1748,7 +1748,7 @@ { /* 256 is for Solaris, under Linux ENAMETOOLONG is returned if not large enough. */ - int len = 256, res; + int len = 256, res, save_errno; char *p = scm_malloc (len); SCM name; @@ -1761,7 +1761,9 @@ } if (res == -1) { + save_errno = errno; free (p); + errno = save_errno; SCM_SYSERROR; } name = scm_makfrom0str (p); --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--