Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jun 2006 06:35:47 GMT
From:      Alex Lyashkov <als@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 99585 for review
Message-ID:  <200606190635.k5J6Zl1M021824@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=99585

Change 99585 by als@als_head on 2006/06/19 06:35:43

	Whitespace cleanup. use sysexits(3).

Affected files ...

.. //depot/projects/jail2/j2_tools/jdisk/jdisk.c#2 edit

Differences ...

==== //depot/projects/jail2/j2_tools/jdisk/jdisk.c#2 (text+ko) ====

@@ -7,6 +7,7 @@
 #include <sys/jail2.h>
 
 #include <stdlib.h>
+#include <sysexits.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <err.h>
@@ -19,48 +20,46 @@
 int
 main(int argc, char **argv)
 {
-	int ch;
+	int	ch;
 	char *error;
 	struct jail_2 j;
-	int ret;
-/*	int limit; */
-	
-        /* options descriptor */
-        static struct option longopts[] = {
-             { "ctx",		required_argument,	NULL,           C_CTX },
-             { "vroot",		required_argument,	NULL,           C_VROOT },
-             { NULL,         	0,                      NULL,           0 }
-        };
+	int	ret;
+
+	/* options descriptor */
+	static struct option longopts[] = {
+		{"ctx",		required_argument,	NULL, C_CTX},
+		{"vroot",	required_argument,	NULL, C_VROOT},
+		{NULL,		0,					NULL, 0}
+	};
 
 	j.version = 2;
 	j.ctx_id = 0;
 	j.data = NULL;
 	j.cmd = 0;
-        while ((ch = getopt_long(argc, argv, "", longopts, NULL)) != -1)
-        {
-		switch( ch ) {
+	while ((ch = getopt_long(argc, argv, "", longopts, NULL)) != -1) {
+		switch (ch) {
 		case C_CTX:
-			j.ctx_id = strtol(optarg,&error,10);
-			if( *error != '\0' )
-				errx(1,"Error in context identifyer");    
+			j.ctx_id = strtol(optarg, &error, 10);
+			if (*error != '\0')
+				errx(1, "Error in context identifyer");
 			break;
 		case C_VROOT:
 			j.cmd = C_VROOT;
-			j.data=optarg;
+			j.data = optarg;
 			ret = jail(&j);
-			if(ret != 0)
+			if (ret != 0)
 				err(2, "%s", "Set vroot");
 			break;
 		default:
 			usage();
-			errx(100,"Unknow command");
+			errx(100, "Unknow command");
 		}
 	}
-	return( 0 );
+	return (EX_OK);
 }
 
 static void
 usage(void)
 {
-	exit(1);
+	exit(EX_USAGE);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606190635.k5J6Zl1M021824>