stat-util: fix fd_is_network_ns()
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Mar 2018 08:47:04 +0000 (09:47 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Mar 2018 14:29:35 +0000 (15:29 +0100)
This was broken in 77f9fa3b8ea46c27e5a5e9270f71bf1b4000c3e0. My fault.

Fixes: #8543

src/basic/stat-util.c

index 3689f6e..6770594 100644 (file)
@@ -254,7 +254,8 @@ int fd_is_network_ns(int fd) {
         if (r <= 0)
                 return r;
 
-        if (ioctl(fd, NS_GET_NSTYPE) < 0)
+        r = ioctl(fd, NS_GET_NSTYPE);
+        if (r < 0)
                 return -errno;
 
         return r == CLONE_NEWNET;