chiark / gitweb /
bus: fix error check in memfd code
[elogind.git] / src / libsystemd-bus / sd-memfd.c
index 98a8e0893a26723263ad70f54eb8b1300951eff2..2712a26f66057eef31305df76db52148defb11f1 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)