chiark / gitweb /
bus: fix error check in memfd code
authorLennart Poettering <lennart@poettering.net>
Fri, 10 May 2013 17:15:55 +0000 (19:15 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 10 May 2013 17:15:55 +0000 (19:15 +0200)
src/libsystemd-bus/sd-memfd.c

index 98a8e08..2712a26 100644 (file)
@@ -43,7 +43,7 @@ int sd_memfd_new(sd_memfd **m) {
                 return -EINVAL;
 
         kdbus = open("/dev/kdbus/control", O_RDWR|O_NOCTTY|O_CLOEXEC);
-        if (fd < 0)
+        if (kdbus < 0)
                 return -errno;
 
         if (ioctl(kdbus, KDBUS_CMD_MEMFD_NEW, &fd) < 0)