bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fix xgethostname on OSX [patch]


From: Jim Meyering
Subject: Re: fix xgethostname on OSX [patch]
Date: Sun, 20 Feb 2005 17:39:22 +0100

"Mark D. Baushke" <address@hidden> wrote:
...
>   2) It seems that the patch you sent was stripped
>      by the list software on gnu.org (normally it
>      throws away attachments of any kind).
...
> I am adding address@hidden to this message so
> that they see a description of your problem. They
> may wish to consider an MacOSX change even without
> the patch your message to address@hidden was
> missing.
...
>> 2005-02-21  Neil Conway  <address@hidden>
>>
>>      * lib/xgethostname.c: Check for ENOMEM, which is returned by
>>      OSX/Darwin if the specified buffer is not large enough for the
>>      hostname.

Thanks for forwarding that.
I've just checked in this change:

2005-02-20  Neil Conway  <address@hidden>

        * xgethostname.c (xgethostname): Check for ENOMEM, which is
        returned by OSX/Darwin if the specified buffer is not large
        enough for the hostname.

Index: xgethostname.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xgethostname.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -u -r1.19 -r1.20
--- xgethostname.c      9 Aug 2004 23:45:32 -0000       1.19
+++ xgethostname.c      20 Feb 2005 16:35:32 -0000      1.20
@@ -1,6 +1,6 @@
 /* xgethostname.c -- return current hostname with unlimited length
 
-   Copyright (C) 1992, 1996, 2000, 2001, 2003, 2004 Free Software
+   Copyright (C) 1992, 1996, 2000, 2001, 2003, 2004, 2005 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -69,7 +69,9 @@ xgethostname (void)
          if (! hostname[size_1 - 1])
            break;
        }
-      else if (errno != 0 && errno != ENAMETOOLONG && errno != EINVAL)
+      else if (errno != 0 && errno != ENAMETOOLONG && errno != EINVAL
+              /* OSX/Darwin does this when the buffer is not large enough */
+              && errno != ENOMEM)
        {
          int saved_errno = errno;
          free (hostname);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]