From owner-freebsd-doc@FreeBSD.ORG Mon Jul 28 11:50:01 2008 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DF41065674 for ; Mon, 28 Jul 2008 11:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0578B8FC22 for ; Mon, 28 Jul 2008 11:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m6SBo05p086790 for ; Mon, 28 Jul 2008 11:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m6SBo0Ss086789; Mon, 28 Jul 2008 11:50:00 GMT (envelope-from gnats) Resent-Date: Mon, 28 Jul 2008 11:50:00 GMT Resent-Message-Id: <200807281150.m6SBo0Ss086789@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gavin Atkinson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E9A91065677 for ; Mon, 28 Jul 2008 11:48:47 +0000 (UTC) (envelope-from ga9@buffy.york.ac.uk) Received: from mail-gw0.york.ac.uk (mail-gw0.york.ac.uk [144.32.128.245]) by mx1.freebsd.org (Postfix) with ESMTP id 1D1BE8FC1C for ; Mon, 28 Jul 2008 11:48:46 +0000 (UTC) (envelope-from ga9@buffy.york.ac.uk) Received: from mail-gw6.york.ac.uk (mail-gw6.york.ac.uk [144.32.129.26]) by mail-gw0.york.ac.uk (8.13.6/8.13.6) with ESMTP id m6SBmiFt018175 for ; Mon, 28 Jul 2008 12:48:44 +0100 (BST) Received: from buffy-128.york.ac.uk ([144.32.128.160] helo=buffy.york.ac.uk) by mail-gw6.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KNRDY-00065Y-5G for FreeBSD-gnats-submit@freebsd.org; Mon, 28 Jul 2008 12:48:44 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.2/8.14.2) with ESMTP id m6SBmhZ8064185 for ; Mon, 28 Jul 2008 12:48:43 +0100 (BST) (envelope-from ga9@buffy.york.ac.uk) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.2/8.14.2/Submit) id m6SBmhFo064184; Mon, 28 Jul 2008 12:48:43 +0100 (BST) (envelope-from ga9) Message-Id: <200807281148.m6SBmhFo064184@buffy.york.ac.uk> Date: Mon, 28 Jul 2008 12:48:43 +0100 (BST) From: Gavin Atkinson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: docs/126031: [patch] updates to developers handbook: sockets section X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gavin Atkinson List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2008 11:50:01 -0000 >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@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: