summaryrefslogtreecommitdiff
path: root/Distrib
diff options
context:
space:
mode:
authorTWikiGuest <web-hurd@gnu.org>2005-01-13 22:25:11 +0000
committerTWikiGuest <web-hurd@gnu.org>2005-01-13 22:25:11 +0000
commit0108b56885e43739936d94a0e3d8aa75075608a1 (patch)
tree68d3ca2a9412333e0447f3768f2e5bc794daaf34 /Distrib
parent12aa0ce2e0b0da405901bc68b55ea749ae0e493d (diff)
none
Diffstat (limited to 'Distrib')
-rw-r--r--Distrib/PortingIssues.mdwn25
1 files changed, 12 insertions, 13 deletions
diff --git a/Distrib/PortingIssues.mdwn b/Distrib/PortingIssues.mdwn
index 4b78748b..1f9def8c 100644
--- a/Distrib/PortingIssues.mdwn
+++ b/Distrib/PortingIssues.mdwn
@@ -65,24 +65,19 @@ Buggy code:
Fixed code:
- #ifndef MAXHOSTNAMELEN
#include "xgethostname.h"
- #endif
...
- #ifdef MAXHOSTNAMELEN
- char localhost[MAXHOSTNAMELEN];
- #else
-
char *localhost;
- #endif
-
...
- #ifdef MAXHOSTNAMELEN
-
- gethostname(localhost, sizeof(localhost));
- #else
localhost = xgethostname();
- #endif
+ if (! localhost)
+ {
+ perror ("xgethostname");
+ return ERROR;
+ }
+ ...
+ /* use LOCALHOST. */
+ free (localhost);
## <a name="NOFILE_tt_"> `NOFILE` </a>
@@ -168,6 +163,10 @@ See [a simple fix for TIOCFLUSH in telnet](http://mail.gnu.org/archive/html/bug-
## <a name="ChangeLog"> ChangeLog </a>
+-- [[Main/TWikiGuest]] - 13 Jan 2005
+
+Fix xgethostname example. - Neal
+
-- [[Main/RobertMillan]] - 22 Jul 2002
Formatting and minor grammatical fixes.