Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2009 22:23:29 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 166705 for review
Message-ID:  <200907282223.n6SMNTQk049148@repoman.freebsd.org>

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

Change 166705 by rwatson@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);
 		}



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