fix: move lttng_close_on_exec to proper wrapper
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 24 Feb 2020 20:15:36 +0000 (15:15 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Feb 2020 21:50:25 +0000 (16:50 -0500)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I330c6d63fc9c1af00c9a9471563d322d036b9a9c

lttng-statedump-impl.c
wrapper/fdtable.h
wrapper/time.h [deleted file]

index baa5a1efd33e56aa7ab545766e41b7fde363b458..5225186be48b6c24a7a282a16caddc4955e6b590 100644 (file)
@@ -28,7 +28,6 @@
 #include <linux/inetdevice.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/fdtable.h>
 #include <linux/swap.h>
 #include <linux/wait.h>
 #include <linux/mutex.h>
@@ -43,7 +42,7 @@
 #include <wrapper/tracepoint.h>
 #include <wrapper/genhd.h>
 #include <wrapper/file.h>
-#include <wrapper/time.h>
+#include <wrapper/fdtable.h>
 
 #ifdef CONFIG_LTTNG_HAS_LIST_IRQ
 #include <linux/irq.h>
index 72830a50df3ff595b74d541695cabe3132ce4a04..8f73559796a0655cdd36e770c674c60e23ba4a46 100644 (file)
@@ -28,4 +28,21 @@ int lttng_iterate_fd(struct files_struct *files,
 #define lttng_iterate_fd       iterate_fd
 
 #endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+
+static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt)
+{
+       return close_on_exec(fd, fdt);
+}
+
+#else
+
+static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt)
+{
+       return FD_ISSET(fd, fdt->close_on_exec);
+}
+
+#endif
+
 #endif /* _LTTNG_WRAPPER_FDTABLE_H */
diff --git a/wrapper/time.h b/wrapper/time.h
deleted file mode 100644 (file)
index 527615a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1)
- *
- * wrapper/time.h
- *
- * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_WRAPPER_TIME_H
-#define _LTTNG_WRAPPER_TIME_H
-
-#include <linux/version.h>
-#include <linux/time.h>
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
-
-static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt)
-{
-       return close_on_exec(fd, fdt);
-}
-
-#else
-
-static inline bool lttng_close_on_exec(int fd, const struct fdtable *fdt)
-{
-       return FD_ISSET(fd, fdt->close_on_exec);
-}
-
-#endif
-
-#endif /* _LTTNG_WRAPPER_TIME_H */
This page took 0.026564 seconds and 4 git commands to generate.