chiark / gitweb /
Display synthetic message serial number in a more readable format than (uint32_t) -1
[elogind.git] / src / libsystemd-bus / bus-container.c
index eac1863244106a93aa42e5017a4afed2e8cf1874..25ea471a08475085d00b0c2166f554a02e429b18 100644 (file)
@@ -44,6 +44,8 @@ int bus_container_connect(sd_bus *b) {
                 return -ENOMEM;
 
         r = parse_env_file(p, NEWLINE, "LEADER", &s, "CLASS", &class, NULL);
+        if (r == -ENOENT)
+                return -EHOSTDOWN;
         if (r < 0)
                 return r;
         if (!s)
@@ -70,7 +72,7 @@ int bus_container_connect(sd_bus *b) {
         if (r < 0)
                 return -ENOMEM;
 
-        rootfd = open(root, O_RDONLY|O_NOCTTY|O_CLOEXEC);
+        rootfd = open(root, O_RDONLY|O_NOCTTY|O_CLOEXEC|O_DIRECTORY);
         if (rootfd < 0)
                 return -errno;
 
@@ -99,7 +101,6 @@ int bus_container_connect(sd_bus *b) {
                 if (chroot(".") < 0)
                         _exit(255);
 
-
                 r = connect(b->input_fd, &b->sockaddr.sa, b->sockaddr_size);
                 if (r < 0) {
                         if (errno == EINPROGRESS)