chiark / gitweb /
bus: catch up with kernel changes
[elogind.git] / src / nspawn / nspawn.c
index c25768245179cad1e2a1be819395d8ab4b65d7b5..f57c75ffeeb8f11935086cd398ef34a750705e49 100644 (file)
@@ -365,7 +365,7 @@ static int mount_all(const char *dest) {
         int r = 0;
 
         for (k = 0; k < ELEMENTSOF(mount_table); k++) {
-                char _cleanup_free_ *where = NULL;
+                _cleanup_free_ char *where = NULL;
                 int t;
 
                 where = strjoin(dest, "/", mount_table[k].where, NULL);
@@ -515,7 +515,7 @@ static int setup_resolv_conf(const char *dest) {
 }
 
 static int setup_boot_id(const char *dest) {
-        char _cleanup_free_ *from = NULL, *to = NULL;
+        _cleanup_free_ char *from = NULL, *to = NULL;
         sd_id128_t rnd;
         char as_uuid[37];
         int r;
@@ -569,7 +569,7 @@ static int copy_devnodes(const char *dest) {
 
         const char *d;
         int r = 0;
-        mode_t _cleanup_umask_ u;
+        _cleanup_umask_ mode_t u;
 
         assert(dest);
 
@@ -577,7 +577,7 @@ static int copy_devnodes(const char *dest) {
 
         NULSTR_FOREACH(d, devnodes) {
                 struct stat st;
-                char _cleanup_free_ *from = NULL, *to = NULL;
+                _cleanup_free_ char *from = NULL, *to = NULL;
 
                 asprintf(&from, "/dev/%s", d);
                 asprintf(&to, "%s/dev/%s", dest, d);
@@ -633,9 +633,9 @@ static int setup_ptmx(const char *dest) {
 
 static int setup_dev_console(const char *dest, const char *console) {
         struct stat st;
-        char _cleanup_free_ *to = NULL;
+        _cleanup_free_ char *to = NULL;
         int r;
-        mode_t _cleanup_umask_ u;
+        _cleanup_umask_ mode_t u;
 
         assert(dest);
         assert(console);
@@ -681,9 +681,9 @@ static int setup_dev_console(const char *dest, const char *console) {
 }
 
 static int setup_kmsg(const char *dest, int kmsg_socket) {
-        char _cleanup_free_ *from = NULL, *to = NULL;
+        _cleanup_free_ char *from = NULL, *to = NULL;
         int r, fd, k;
-        mode_t _cleanup_umask_ u;
+        _cleanup_umask_ mode_t u;
         union {
                 struct cmsghdr cmsghdr;
                 uint8_t buf[CMSG_SPACE(sizeof(int))];
@@ -765,7 +765,7 @@ static int setup_hostname(void) {
 
 static int setup_journal(const char *directory) {
         sd_id128_t machine_id;
-        char _cleanup_free_ *p = NULL, *b = NULL, *q = NULL, *d = NULL;
+        _cleanup_free_ char *p = NULL, *b = NULL, *q = NULL, *d = NULL;
         char *id;
         int r;
 
@@ -918,20 +918,6 @@ static int drop_capabilities(void) {
         return capability_bounding_set_drop(~arg_retain, false);
 }
 
-static int is_os_tree(const char *path) {
-        int r;
-        char *p;
-        /* We use /bin/sh as flag file if something is an OS */
-
-        if (asprintf(&p, "%s/bin/sh", path) < 0)
-                return -ENOMEM;
-
-        r = access(p, F_OK);
-        free(p);
-
-        return r < 0 ? 0 : 1;
-}
-
 static int process_pty(int master, pid_t pid, sigset_t *mask) {
 
         char in_buffer[LINE_MAX], out_buffer[LINE_MAX];
@@ -1240,7 +1226,7 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        if (is_os_tree(arg_directory) <= 0) {
+        if (path_is_os_tree(arg_directory) <= 0) {
                 log_error("Directory %s doesn't look like an OS root directory. Refusing.", arg_directory);
                 goto finish;
         }