Browse Source

jail: only output BPF instr. table header if debugging

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Golle 3 years ago
parent
commit
0a74c067f9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      jail/seccomp-oci.c

+ 3 - 2
jail/seccomp-oci.c

@@ -407,14 +407,15 @@ struct sock_fprog *parseOCIlinuxseccomp(struct blob_attr *msg)
 	prog->filter = filter;
 
 	DEBUG("generated seccomp-bpf program:\n");
-	fprintf(stderr, " [idx]\tcode\t jt\t jf\tk\n");
-	if (debug)
+	if (debug) {
+		fprintf(stderr, " [idx]\tcode\t jt\t jf\tk\n");
 		for (idx=0; idx<sz; idx++)
 			fprintf(stderr, " [%03d]\t%04hx\t%3hhu\t%3hhu\t%08x\n", idx,
 				filter[idx].code,
 				filter[idx].jt,
 				filter[idx].jf,
 				filter[idx].k);
+	}
 
 	return prog;