[DGD] Driver error message patch
Keith Dunwoody
keithdunwoody at yahoo.com
Mon Oct 14 19:42:36 CEST 2002
May I suggest the following patch for the driver? On
linux systems, it will return more accurate
information if this call fails. Originally, this call
would print "gethostbyname: No such file or
directory", which I found misleading. After the
patch, it will print the hostname, followed by ": Host
not found" (or something like that).
-- Keith
P.S. According to the man page herror() is obselete,
but I couln't find any equivilent.
-- Patch begins here--
diff -c -r src-clean/host/unix/connect.c
src/host/unix/connect.c
*** src-clean/host/unix/connect.c Mon Oct 14
10:19:59 2002
--- src/host/unix/connect.c Mon Oct 14 10:15:31
2002
***************
*** 375,381 ****
--- 375,385 ----
gethostname(buffer, MAXHOSTNAMELEN);
host = gethostbyname(buffer);
if (host == (struct hostent *) NULL) {
+ #ifdef LINUX
+ herror(buffer);
+ #else
perror("gethostbyname");
+ #endif
return FALSE;
}
addrtype = host->h_addrtype;
__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list