From 0108b56885e43739936d94a0e3d8aa75075608a1 Mon Sep 17 00:00:00 2001 From: TWikiGuest Date: Thu, 13 Jan 2005 22:25:11 +0000 Subject: none --- Distrib/PortingIssues.mdwn | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'Distrib') 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); ## `NOFILE` @@ -168,6 +163,10 @@ See [a simple fix for TIOCFLUSH in telnet](http://mail.gnu.org/archive/html/bug- ## ChangeLog +-- [[Main/TWikiGuest]] - 13 Jan 2005 + +Fix xgethostname example. - Neal + -- [[Main/RobertMillan]] - 22 Jul 2002 Formatting and minor grammatical fixes. -- cgit v1.2.3