about summary refs log tree commit diff
path: root/support/support_enter_network_namespace.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-03-15 13:13:58 +0100
committerFlorian Weimer <fweimer@redhat.com>2017-03-15 13:33:40 +0100
commited3ea040bae8ef2cf131081124a1248a9fd3dca9 (patch)
treeaba1792fff5e2c4887d67198f91afb5cb1c8f8da /support/support_enter_network_namespace.c
parentf889e73f603dcf90b4db6a2065104a78c1a0e94d (diff)
downloadglibc-ed3ea040bae8ef2cf131081124a1248a9fd3dca9.tar.gz
glibc-ed3ea040bae8ef2cf131081124a1248a9fd3dca9.tar.xz
glibc-ed3ea040bae8ef2cf131081124a1248a9fd3dca9.zip
support: Add error checking to close system calls [BZ #21244]
Diffstat (limited to 'support/support_enter_network_namespace.c')
-rw-r--r--support/support_enter_network_namespace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/support/support_enter_network_namespace.c b/support/support_enter_network_namespace.c
index d2e78fe560..28b0ee29cf 100644
--- a/support/support_enter_network_namespace.c
+++ b/support/support_enter_network_namespace.c
@@ -23,9 +23,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <support/check.h>
+#include <support/xsocket.h>
+#include <support/xunistd.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
-#include <xsocket.h>
 
 static bool in_uts_namespace;
 
@@ -58,7 +59,7 @@ support_enter_network_namespace (void)
           req.ifr_flags |= IFF_UP | IFF_RUNNING;
           TEST_VERIFY_EXIT (ioctl (fd, SIOCSIFFLAGS, &req) == 0);
         }
-      close (fd);
+      xclose (fd);
 
       return !already_up;
     }