chiark / gitweb /
machined: fix check if host directory could be opened
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 24 Feb 2015 19:47:53 +0000 (20:47 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 24 Feb 2015 19:51:28 +0000 (20:51 +0100)
CID#1271351

src/machine/machine-dbus.c

index 334abbdeb5e371ad7cff8ae11044a044a3987a25..15c915940566883262cb8514fee0f7796e496bd2 100644 (file)
@@ -871,7 +871,7 @@ int bus_machine_method_copy(sd_bus *bus, sd_bus_message *message, void *userdata
         container_dirname = dirname(t);
 
         hostfd = open(host_dirname, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_DIRECTORY);
-        if (r < 0)
+        if (hostfd < 0)
                 return sd_bus_error_set_errnof(error, errno, "Failed to open host directory %s: %m", host_dirname);
 
         if (pipe2(errno_pipe_fd, O_CLOEXEC|O_NONBLOCK) < 0)