docs/126031: [patch] updates to developers handbook: sockets section

Gavin Atkinson gavin at FreeBSD.org
Mon Jul 28 11:50:01 UTC 2008


>Number:         126031
>Category:       docs
>Synopsis:       [patch] updates to developers handbook: sockets section
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 28 11:50:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Gavin Atkinson
>Release:        FreeBSD 7.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD buffy.york.ac.uk 7.0-STABLE FreeBSD 7.0-STABLE #3: Fri Jun 20 09:21:51 UTC 2008 root at buffy.york.ac.uk:/usr/obj/usr/src/sys/GENERIC amd64

>Description:
	Minor updates to the (otherwise very good) sockets tutorial:
 - Include string.h to avoid compile warning about using bzero without defining it
 - use herror() rather than perror() to give useful error messages (the *hostby*()
   functions set h_errno not errno)
>How-To-Repeat:
	compile and test the code examples
>Fix:

--- devh-sockets.diff begins here ---
Index: doc/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml
===================================================================
RCS file: /home/dcvs/doc/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml,v
retrieving revision 1.15
diff -u -r1.15 chapter.sgml
--- doc/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml	5 Jan 2006 20:03:35 -0000	1.15
+++ doc/en_US.ISO8859-1/books/developers-handbook/sockets/chapter.sgml	28 Jul 2008 11:44:41 -0000
@@ -966,6 +966,7 @@
  * Programmed by G. Adam Stanislav
  */
 #include <stdio.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -1181,6 +1182,7 @@
  * June 19, 2001
  */
 #include <stdio.h>
+#include <string.h>
 #include <time.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -1582,7 +1584,7 @@
   host = (argc > 1) ? (char *)argv[1] : "time.nist.gov";
 
   if ((he = gethostbyname(host)) == NULL) {
-    perror(host);
+    herror(host);
     return 2;
   }
 
--- devh-sockets.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list