chiark / gitweb /
fsckd: the error code is actually returned in 'fd'
[elogind.git] / src / test / test-ns.c
index acad725899aa5686b5d842c83f4e6c293886bc7b..76b131c284449b6c95d1e2a3165f7f1a62b5c8f8 100644 (file)
 ***/
 
 #include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
-#include <sys/mount.h>
-#include <linux/fs.h>
 
 #include "namespace.h"
-#include "execute.h"
 #include "log.h"
 
 int main(int argc, char *argv[]) {
@@ -59,17 +55,18 @@ int main(int argc, char *argv[]) {
                             (char **) inaccessible,
                             tmp_dir,
                             var_tmp_dir,
+                            NULL,
                             true,
                             PROTECT_HOME_NO,
                             PROTECT_SYSTEM_NO,
                             0);
         if (r < 0) {
-                log_error("Failed to setup namespace: %s", strerror(-r));
+                log_error_errno(r, "Failed to setup namespace: %m");
                 return 1;
         }
 
         execl("/bin/sh", "/bin/sh", NULL);
-        log_error("execl(): %m");
+        log_error_errno(errno, "execl(): %m");
 
         return 1;
 }