aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2024-04-28 23:22:13 +0200
committerThomas Weißschuh <thomas@t-8ch.de>2024-04-28 23:27:06 +0200
commitea0c351409b26d1b288442b8cc206bd908e64faf (patch)
tree0a177e23fb3e0188c47a4bb9d1c62202d794507e
parent93128b74c439e9faba7c7a3912cb4312bcc087d1 (diff)
downloadutil-linux-ea0c351409b26d1b288442b8cc206bd908e64faf.tar.gz
lsfd: move interface of decode-file-flags to header
Use a proper header file to declare lsfd_decode_file_flags(). Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
-rw-r--r--lsfd-cmd/Makemodule.am1
-rw-r--r--lsfd-cmd/decode-file-flags.c3
-rw-r--r--lsfd-cmd/decode-file-flags.h8
-rw-r--r--lsfd-cmd/file.c2
4 files changed, 11 insertions, 3 deletions
diff --git a/lsfd-cmd/Makemodule.am b/lsfd-cmd/Makemodule.am
index 577a780f5e..d28f869589 100644
--- a/lsfd-cmd/Makemodule.am
+++ b/lsfd-cmd/Makemodule.am
@@ -9,6 +9,7 @@ lsfd_SOURCES = \
lsfd-cmd/lsfd.c \
lsfd-cmd/lsfd.h \
lsfd-cmd/decode-file-flags.c \
+ lsfd-cmd/decode-file-flags.h \
lsfd-cmd/file.c \
lsfd-cmd/cdev.c \
lsfd-cmd/bdev.c \
diff --git a/lsfd-cmd/decode-file-flags.c b/lsfd-cmd/decode-file-flags.c
index bd87c7d794..7035d79d17 100644
--- a/lsfd-cmd/decode-file-flags.c
+++ b/lsfd-cmd/decode-file-flags.c
@@ -50,9 +50,8 @@
#endif
#include <stddef.h> /* for size_t */
-struct ul_buffer;
-void lsfd_decode_file_flags(struct ul_buffer *buf, int flags);
+#include "decode-file-flags.h"
/* We cannot include buffer.h because buffer.h includes
* /usr/include/fcntl.h indirectly. */
diff --git a/lsfd-cmd/decode-file-flags.h b/lsfd-cmd/decode-file-flags.h
new file mode 100644
index 0000000000..88cd0d0bef
--- /dev/null
+++ b/lsfd-cmd/decode-file-flags.h
@@ -0,0 +1,8 @@
+#ifndef UTIL_LINUX_LSFD_DECODE_FILE_FLAGS_H
+#define UTIL_LINUX_LSFD_DECODE_FILE_FLAGS_H
+
+struct ul_buffer;
+
+void lsfd_decode_file_flags(struct ul_buffer *buf, int flags);
+
+#endif /* UTIL_LINUX_LSFD_DECODE_FILE_FLAGS_H */
diff --git a/lsfd-cmd/file.c b/lsfd-cmd/file.c
index 25477cf2f1..02db8da5ee 100644
--- a/lsfd-cmd/file.c
+++ b/lsfd-cmd/file.c
@@ -47,6 +47,7 @@
#include "lsfd.h"
#include "pidfd.h"
#include "pidfd-utils.h"
+#include "decode-file-flags.h"
static size_t pagesize;
@@ -84,7 +85,6 @@ static const char *assocstr[N_ASSOCS] = {
[ASSOC_SHM] = "shm",
};
-extern void lsfd_decode_file_flags(struct ul_buffer *buf, int flags);
static void file_fill_flags_buf(struct ul_buffer *buf, int flags)
{
lsfd_decode_file_flags(buf, flags);