From owner-svn-src-all@FreeBSD.ORG Sun Apr 18 04:15:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C980106564A; Sun, 18 Apr 2010 04:15:21 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70C3B8FC1C; Sun, 18 Apr 2010 04:15:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3I4FLtx067202; Sun, 18 Apr 2010 04:15:21 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3I4FLoY067199; Sun, 18 Apr 2010 04:15:21 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004180415.o3I4FLoY067199@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 18 Apr 2010 04:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206785 - in stable/8/usr.sbin: . services_mkdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2010 04:15:21 -0000 Author: ume Date: Sun Apr 18 04:15:21 2010 New Revision: 206785 URL: http://svn.freebsd.org/changeset/base/206785 Log: MFC r206156, r206159, r206163: services_mkdb; generate db file from services(5) to increase speed of getserv*() Added: - copied from r206156, head/usr.sbin/services_mkdb/ Directory Properties: stable/8/usr.sbin/services_mkdb/ (props changed) Modified: stable/8/usr.sbin/Makefile (contents, props changed) stable/8/usr.sbin/services_mkdb/services_mkdb.c Modified: stable/8/usr.sbin/Makefile ============================================================================== --- stable/8/usr.sbin/Makefile Sun Apr 18 04:07:32 2010 (r206784) +++ stable/8/usr.sbin/Makefile Sun Apr 18 04:15:21 2010 (r206785) @@ -168,6 +168,7 @@ SUBDIR= ${_ac} \ ${_sade} \ ${_sendmail} \ service \ + services_mkdb \ setfib \ setfmac \ setpmac \ Modified: stable/8/usr.sbin/services_mkdb/services_mkdb.c ============================================================================== --- head/usr.sbin/services_mkdb/services_mkdb.c Sun Apr 4 08:38:14 2010 (r206156) +++ stable/8/usr.sbin/services_mkdb/services_mkdb.c Sun Apr 18 04:15:21 2010 (r206785) @@ -219,7 +219,7 @@ parseservices(const char *fname, StringL line = 0; if ((svc = calloc(PMASK + 1, sizeof(StringList **))) == NULL) - err(1, "Cannot allocate %zu bytes", PMASK + 1); + err(1, "Cannot allocate %zu bytes", (size_t)(PMASK + 1)); /* XXX: change NULL to "\0\0#" when fparseln fixed */ for (; (p = fparseln(fp, &len, &line, NULL, 0)) != NULL; free(p)) { @@ -271,7 +271,8 @@ parseservices(const char *fname, StringL if (svc[pnum] == NULL) { svc[pnum] = calloc(PROTOMAX, sizeof(StringList *)); if (svc[pnum] == NULL) - err(1, "Cannot allocate %zu bytes", PROTOMAX); + err(1, "Cannot allocate %zu bytes", + (size_t)PROTOMAX); } pindex = getprotoindex(sl, proto); @@ -282,11 +283,11 @@ parseservices(const char *fname, StringL /* build list of aliases */ if (sl_find(s, name) == NULL) { - char *p; + char *p2; - if ((p = strdup(name)) == NULL) + if ((p2 = strdup(name)) == NULL) err(1, "Cannot copy string"); - (void)sl_add(s, p); + (void)sl_add(s, p2); } if (aliases) { @@ -294,11 +295,11 @@ parseservices(const char *fname, StringL if (alias[0] == '\0') continue; if (sl_find(s, alias) == NULL) { - char *p; + char *p2; - if ((p = strdup(alias)) == NULL) + if ((p2 = strdup(alias)) == NULL) err(1, "Cannot copy string"); - (void)sl_add(s, p); + (void)sl_add(s, p2); } } }