unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* gethostname errno
@ 2004-03-19 22:12 Kevin Ryde
  2004-03-20 21:05 ` Marius Vollmer
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2004-03-19 22:12 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

        * 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.


[-- Attachment #2: posix.c.gethostname-errno.diff --]
[-- Type: text/plain, Size: 512 bytes --]

--- 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);

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gethostname errno
  2004-03-19 22:12 gethostname errno Kevin Ryde
@ 2004-03-20 21:05 ` Marius Vollmer
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2004-03-20 21:05 UTC (permalink / raw)


Kevin Ryde <user42@zip.com.au> writes:

> This will be for the 1.6 branch too I think.

Yes, please.  Thanks!

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-20 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-19 22:12 gethostname errno Kevin Ryde
2004-03-20 21:05 ` Marius Vollmer

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).