sandbox.c: small refactor
authordisconnect3d <dominik.b.czarnota@gmail.com>
Sun, 8 Oct 2017 00:57:49 +0000 (02:57 +0200)
committerdisconnect3d <dominik.b.czarnota@gmail.com>
Sun, 8 Oct 2017 00:57:49 +0000 (02:57 +0200)
sandbox.c

index 175f9fae4f14bdf7fc7c6c822d6fd12b5894853e..c1eb9f8edc070c89f89e00ed05bfef2d7904b8ae 100644 (file)
--- a/sandbox.c
+++ b/sandbox.c
 #include "kafel.h"
 #include "log.h"
 
-#ifndef PR_SET_NO_NEW_PRIVS
+#ifndef PR_SET_NO_NEW_PRIVS /* in prctl.h since Linux 3.5 */
 #define PR_SET_NO_NEW_PRIVS 38
 #endif                         /* PR_SET_NO_NEW_PRIVS */
 
-static bool sandboxPrepareAndCommit(struct nsjconf_t *nsjconf __attribute__ ((unused)))
+static bool sandboxPrepareAndCommit(struct nsjconf_t *nsjconf)
 {
        if (nsjconf->kafel_file == NULL && nsjconf->kafel_string == NULL) {
                return true;
@@ -68,8 +68,5 @@ static bool sandboxPrepareAndCommit(struct nsjconf_t *nsjconf __attribute__ ((un
 
 bool sandboxApply(struct nsjconf_t * nsjconf)
 {
-       if (sandboxPrepareAndCommit(nsjconf) == false) {
-               return false;
-       }
-       return true;
+       return sandboxPrepareAndCommit(nsjconf);
 }