Work around warn_unused_result in recent gcc/libc
[project/netifd.git] / handler.c
index f4e27e1..c5e47ad 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -27,14 +27,14 @@ netifd_dir_push(int fd)
        int prev_fd = open(".", O_RDONLY | O_DIRECTORY);
        system_fd_set_cloexec(prev_fd);
        if (fd >= 0)
-               fchdir(fd);
+               if (fchdir(fd)) {}
        return prev_fd;
 }
 
 static void
 netifd_dir_pop(int prev_fd)
 {
-       fchdir(prev_fd);
+       if (fchdir(prev_fd)) {}
        close(prev_fd);
 }