[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gethostname errno
From: |
Kevin Ryde |
Subject: |
gethostname errno |
Date: |
Sat, 20 Mar 2004 08:12:30 +1000 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
* 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.
--- 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);
- gethostname errno,
Kevin Ryde <=