From 2fcaae3bf56091020610f6216ae26ec2af210abe Mon Sep 17 00:00:00 2001 From: kristapsdz Date: Fri, 17 Jul 2020 12:47:32 +0000 Subject: [PATCH] Remove superfluous error messages and style(9). --- sandbox.c | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/sandbox.c b/sandbox.c index 120d4a3..f04bc08 100644 --- a/sandbox.c +++ b/sandbox.c @@ -17,13 +17,13 @@ #include "config.h" #if !HAVE_PLEDGE -#if !HAVE_SECCOMP_FILTER -#if !HAVE_CAPSICUM -#if !HAVE_SANDBOX_INIT -#warning Compiling without a sandbox!? -#endif -#endif -#endif +# if !HAVE_SECCOMP_FILTER +# if !HAVE_CAPSICUM +# if !HAVE_SANDBOX_INIT +# warning Compiling without a sandbox!? +# endif +# endif +# endif #endif #include @@ -52,28 +52,20 @@ int ksandbox_init_child(enum sandtype type, int fd1, int fd2, int fdfiled, int fdaccept) { - #if HAVE_CAPSICUM - if ( ! ksandbox_capsicum_init_child(type, - fd1, fd2, fdfiled, fdaccept)) { - XWARNX("ksandbox_capsicum_init_child"); - return(0); - } + if (!ksandbox_capsicum_init_child + (type, fd1, fd2, fdfiled, fdaccept)) + return 0; #elif HAVE_SANDBOX_INIT - if ( ! ksandbox_darwin_init_child(type)) { - XWARNX("ksandbox_darwin_init_child"); - return(0); - } + if (!ksandbox_darwin_init_child(type)) + return 0; #elif HAVE_PLEDGE - if ( ! ksandbox_pledge_init_child(type)) { - XWARNX("ksandbox_pledge_init_child"); - return(0); - } + if (!ksandbox_pledge_init_child(type)) + return 0; #elif HAVE_SECCOMP_FILTER - if ( ! ksandbox_seccomp_init_child(type)) { - XWARNX("ksandbox_seccomp_init_child"); - return(0); - } + if (!ksandbox_seccomp_init_child(type)) + return 0; #endif - return(1); + + return 1; }