Commit Graph

25 Commits

Author SHA1 Message Date
Paul Eggert
2d0c5eefd0 Sync from gnulib. 2005-09-22 06:05:39 +00:00
Jim Meyering
410f98fc2b Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally. 2005-07-02 08:41:46 +00:00
Jim Meyering
116e6fb244 Update FSF postal mail address. 2005-05-14 07:58:06 +00:00
Jim Meyering
84c616fa90 (xgethostname): Check for ENOMEM, which is
returned by OSX/Darwin if the specified buffer is not large
enough for the hostname.
2005-02-20 16:33:03 +00:00
Paul Eggert
9af4ab33f0 Do not include error.h. (merge from gnulib). 2004-08-11 22:24:25 +00:00
Paul Eggert
c87d825fd3 Don't include <sys/types.h> or "exit.h"; no longer needed.
(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.
2004-08-02 21:52:07 +00:00
Jim Meyering
72fa414709 Include xgethostname.h. 2003-10-16 06:26:56 +00:00
Jim Meyering
dce9582d2c Update from gnulib. 2003-09-13 22:01:20 +00:00
Jim Meyering
e151df91d8 Include exit.h.
Remove; now done by exit.h
2003-09-13 10:20:45 +00:00
Jim Meyering
b1b4af8047 Sync with gnulib. 2003-08-18 09:44:49 +00:00
Jim Meyering
9817a27dc0 Normalize naming of Sun operating systems, e.g., SunOS4 -> SunOS 4,
Solaris5.9 -> Solaris 9.  From Paul Eggert.
2003-07-23 06:24:12 +00:00
Jim Meyering
5ef577f0e7 Include <stdlib.h> for declaration of free. 2003-07-13 08:44:23 +00:00
Jim Meyering
497560dfe9 (xgethostname): Return NULL, rather than exiting,
upon any non-malloc/realloc error.
2003-07-13 08:42:40 +00:00
Jim Meyering
bb0d2464f8 Remove declarations of xmalloc and xrealloc.
Include xalloc.h instead.
2001-12-09 21:01:15 +00:00
Jim Meyering
50751a7eff (ENAMETOOLONG): Define to an unlikely value if not defined.
(xgethostname): Remove now-unnecessary #ifdef.
Move declaration of `err' into loop where it's used.
2000-07-09 07:26:34 +00:00
Jim Meyering
3f94561e84 (xgethostname): Protect against the SunOS5.5 bug
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.
2000-07-08 21:48:07 +00:00
Jim Meyering
aa00ea2e88 remove my @comco address 1996-11-21 02:42:52 +00:00
Jim Meyering
fc949b713e (xgethostname): Work around bug in SunOS5.5's gethostname. 1996-11-21 02:38:40 +00:00
Jim Meyering
4d091498a4 Thu Oct 31 19:32:32 1996 Miles Bader <miles@gnu.ai.mit.edu>
[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-11-05 04:38:41 +00:00
Jim Meyering
19bff1c02d indent cpp-directives 1996-07-15 03:56:06 +00:00
Jim Meyering
6014da9e30 update FSF address in copyright 1996-07-15 03:43:36 +00:00
Jim Meyering
0a0800fe25 merge with 1.10n2 1994-09-27 22:02:00 +00:00
Jim Meyering
b98b0e107f merge with 1.10 + local build mods 1994-05-20 13:50:43 +00:00
Jim Meyering
6874eb8797 . 1994-05-13 14:21:20 +00:00
Jim Meyering
3118577120 . 1994-05-02 04:26:07 +00:00