PERFORCE change 183571 for review

Ilya Bakulin kibab at FreeBSD.org
Thu Sep 9 19:01:04 UTC 2010


http://p4web.freebsd.org/@@183571?ac=10

Change 183571 by kibab at 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 <sys/cdefs.h>
 __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 <ctype.h>
@@ -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);
 }


More information about the p4-projects mailing list