summaryrefslogtreecommitdiff
path: root/lib/xgethostname.c
AgeCommit message (Collapse)Author
2005-02-20(xgethostname): Check for ENOMEM, which isJim Meyering
returned by OSX/Darwin if the specified buffer is not large enough for the hostname.
2004-08-11Do not include error.h. (merge from gnulib).Paul Eggert
2004-08-02Don't include <sys/types.h> or "exit.h"; no longer needed.Paul Eggert
(errno): Remove decl; we now assume C89 or better. Include unistd.h if available, for gethostname. (ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with existing errno values if any. (gethostname): Remove decl, since unistd.h declares it (or doesn't, in which case it's an older system and it should just work). (xgethostname): Don't assume host name length is less than INT_MAX. Exit if malloc fails, just as the comment says.
2003-10-16Include xgethostname.h.Jim Meyering
2003-09-13Update from gnulib.Jim Meyering
2003-09-13Include exit.h.Jim Meyering
Remove; now done by exit.h
2003-08-18Sync with gnulib.Jim Meyering
2003-07-23Normalize naming of Sun operating systems, e.g., SunOS4 -> SunOS 4,Jim Meyering
Solaris5.9 -> Solaris 9. From Paul Eggert.
2003-07-13Include <stdlib.h> for declaration of free.Jim Meyering
2003-07-13(xgethostname): Return NULL, rather than exiting,Jim Meyering
upon any non-malloc/realloc error.
2001-12-09Remove declarations of xmalloc and xrealloc.Jim Meyering
Include xalloc.h instead.
2000-07-09(ENAMETOOLONG): Define to an unlikely value if not defined.Jim Meyering
(xgethostname): Remove now-unnecessary #ifdef. Move declaration of `err' into loop where it's used.
2000-07-08(xgethostname): Protect against the SunOS5.5 bugJim Meyering
by allocating a larger buffer. Test the gethostname return value for being >= 0, not == 0, for BeOS. Don't exhaust memory if gethostname returns an error and ENAMETOOLONG isn't defined.
1996-11-21remove my @comco addressJim Meyering
1996-11-21(xgethostname): Work around bug in SunOS5.5's gethostname.Jim Meyering
1996-11-05Thu Oct 31 19:32:32 1996 Miles Bader <miles@gnu.ai.mit.edu>Jim Meyering
[ENAMETOOLONG] (xgethostname): If gethostname returns an error other than buffer overflow, exit with an error message instead of allocating infinite amounts of space. [!EXIT_FAILURE] (EXIT_FAILURE): New macro. <errno.h>: New include. [!errno] (errno): New declaration.
1996-07-15indent cpp-directivesJim Meyering
1996-07-15update FSF address in copyrightJim Meyering
1994-09-27merge with 1.10n2Jim Meyering
1994-05-20merge with 1.10 + local build modsJim Meyering
1994-05-13.Jim Meyering
1994-05-02.Jim Meyering