From owner-p4-projects@FreeBSD.ORG Thu Sep 9 19:01:04 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 794F110656D1; Thu, 9 Sep 2010 19:01:04 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23FA610656CC for ; Thu, 9 Sep 2010 19:01:04 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 11C338FC1A for ; Thu, 9 Sep 2010 19:01:04 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id o89J13Rq028408 for ; Thu, 9 Sep 2010 19:01:03 GMT (envelope-from kibab@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o89J13jd028401 for perforce@freebsd.org; Thu, 9 Sep 2010 19:01:03 GMT (envelope-from kibab@FreeBSD.org) Date: Thu, 9 Sep 2010 19:01:03 GMT Message-Id: <201009091901.o89J13jd028401@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 183571 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 19:01:04 -0000 http://p4web.freebsd.org/@@183571?ac=10 Change 183571 by kibab@kibab_kibab-nb on 2010/09/09 19:01:02 - Style(9). License fix. Affected files ... .. //depot/projects/soc2010/kibab_sysctlreg/src_usr_bin/feature_present/feature_present.c#2 edit Differences ... ==== //depot/projects/soc2010/kibab_sysctlreg/src_usr_bin/feature_present/feature_present.c#2 (text+ko) ==== @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2010, Ilya Bakulin + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,18 +10,11 @@ * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -31,24 +24,14 @@ * SUCH DAMAGE. */ -#ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)feature_present.c 8.1 (Berkeley) 6/6/93"; -#endif -#endif #include __FBSDID("$FreeBSD$"); /* - * feature_present - check if specified feature is supported by the current kernel + * feature_present - check if specified feature + * is supported by the current kernel * - * Author: Ilya Bakulin, SMS Traffic + * Author: Ilya Bakulin */ #include @@ -63,50 +46,49 @@ int main(int argc, char **argv) { - char ch; - int is_quiet; + char ch; + int is_quiet; - is_quiet = 0; - while ((ch = getopt(argc, argv, "q")) != -1) { - switch (ch) { - case 'q': - is_quiet = 1; - break; + is_quiet = 0; + while ((ch = getopt(argc, argv, "q")) != -1) { + switch (ch) { + case 'q': + is_quiet = 1; + break; - case '?': - printf("Received '?'\n"); - default: - usage(); - } - } - - /** - * May begin processing argv as options list, beginning at index optind - */ - int ret, i; - char *feature_to_test; - unsigned short failed_features = 0; - - if(argc >= optind) { - - for(i=optind; i < argc; i++) { - feature_to_test = argv[i]; - ret = feature_present(feature_to_test); - if(!is_quiet) - printf("%s=%d\n", feature_to_test, ret); - if(!ret) - failed_features++; - } - //printf("Total missing features: %d\n", failed_features); - exit(failed_features); - } - + case '?': + printf("Received '?'\n"); + default: + usage(); + } + } + + /** + * May begin processing argv as options list, beginning at index optind + */ + int ret, i; + char *feature_to_test; + unsigned short failed_features = 0; + + if(argc >= optind) { + + for(i=optind; i < argc; i++) { + feature_to_test = argv[i]; + ret = feature_present(feature_to_test); + if(!is_quiet) + printf("%s=%d\n", feature_to_test, ret); + if(!ret) + failed_features++; + } + exit(failed_features); + } + } static void usage(void) { fprintf(stderr, "%s\n", - "usage: feature_present [-q] features list"); + "usage: feature_present [-q] features list"); exit(1); }