PERFORCE change 166705 for review

Robert Watson rwatson at FreeBSD.org
Tue Jul 28 22:23:30 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166705

Change 166705 by rwatson at rwatson_freebsd_capabilities on 2009/07/28 22:23:29

	More minor cleanup.

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_world/sandbox_world.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/tools/cap/sandbox_world/sandbox_world.c#3 (text+ko) ====

@@ -51,7 +51,7 @@
  * doesn't exit until the sandbox is done.
  */
 
-#define	MYNAME	"sandbox_world"
+#define	MYNAME	"sandbox_world"		/* Binary to run in sandbox. */
 
 int
 main(int argc, char *argv[])
@@ -69,6 +69,10 @@
 	    LCH_PERMIT_STDOUT, &lcsp) < 0)
 		err(-1, "lch_start %s", argv[1]);
 
+	/*
+	 * Send a one-byte message to the sandbox and wait for a one-byte
+	 * reply.
+	 */
 	ch = 'X';
 	iov.iov_base = &ch;
 	iov.iov_len = sizeof(ch);
@@ -96,11 +100,10 @@
 		err(-1, "lcs_get");
 
 	while (1) {
-		if (lcs_recvrpc(lchp, &opno, &seqno, &buffer, &len)
-		    < 0) {
+		if (lcs_recvrpc(lchp, &opno, &seqno, &buffer, &len) < 0) {
 			if (errno != EPIPE)
 				err(-6, "lcs_recvrpc");
-				else
+			else
 				exit(-6);
 		}
 		if (len != 1)
@@ -111,7 +114,7 @@
 		iov.iov_len = 1;
 		if (lcs_sendrpc(lchp, opno, seqno, &iov, 1) < 0) {
 			if (errno != EPIPE)
-					err(-8, "lcs_sendrpc");
+				err(-8, "lcs_sendrpc");
 			else
 				exit(-8);
 		}


More information about the p4-projects mailing list