From owner-svn-src-head@freebsd.org Tue Aug 4 02:41:15 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36AFA9AFE78; Tue, 4 Aug 2015 02:41:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23740B85; Tue, 4 Aug 2015 02:41:15 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t742fFNu048173; Tue, 4 Aug 2015 02:41:15 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t742fFDi048172; Tue, 4 Aug 2015 02:41:15 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201508040241.t742fFDi048172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 4 Aug 2015 02:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286267 - head/usr.bin/ypcat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2015 02:41:15 -0000 Author: araujo (ports committer) Date: Tue Aug 4 02:41:14 2015 New Revision: 286267 URL: https://svnweb.freebsd.org/changeset/base/286267 Log: Remove the 3rd clause of BSD LICENSE. Sync the code with the OpenBSD version. Small style(9) fix up. Differential Revision: D3212 Reviewed by: rodrigc, bapt Obtained from: OpenBSD Sponsored by: gandi.net Modified: head/usr.bin/ypcat/ypcat.c Modified: head/usr.bin/ypcat/ypcat.c ============================================================================== --- head/usr.bin/ypcat/ypcat.c Tue Aug 4 02:34:51 2015 (r286266) +++ head/usr.bin/ypcat/ypcat.c Tue Aug 4 02:41:14 2015 (r286267) @@ -1,5 +1,7 @@ +/* $OpenBSD: ypcat.c,v 1.16 2015/02/08 23:40:35 deraadt Exp $ */ + /* - * Copyright (c) 1992/3 Theo de Raadt + * Copyright (c) 1992, 1993, 1996 Theo de Raadt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,9 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -34,18 +33,20 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include +#include #include #include -#include +#include #include -#include -#include -#include -#include -#include -#include +void usage(void); +int printit(u_long, char *, int, char *, int, void *); static const struct ypalias { char *alias, *name; @@ -64,17 +65,18 @@ static const struct ypalias { static int key; -static void +void usage(void) { - fprintf(stderr, "%s\n%s\n", - "usage: ypcat [-kt] [-d domainname] mapname", - " ypcat -x"); + fprintf(stderr, + "usage: ypcat [-kt] [-d domainname] mapname\n" + " ypcat -x\n"); exit(1); } -static int -printit(unsigned long instatus, char *inkey, int inkeylen, char *inval, int invallen, void *dummy __unused) +int +printit(u_long instatus, char *inkey, int inkeylen, char *inval, int invallen, + void *indata) { if (instatus != YP_TRUE) return (instatus); @@ -87,31 +89,29 @@ printit(unsigned long instatus, char *in int main(int argc, char *argv[]) { - char *domainname = NULL; + char *domain = NULL, *inmap; struct ypall_callback ypcb; - char *inmap; - int notrans; - int c, r; + extern char *optarg; + extern int optind; + int notrans, c, r; u_int i; notrans = key = 0; - while ((c = getopt(argc, argv, "xd:kt")) != -1) switch (c) { case 'x': - for (i = 0; i