diff options
author | Karel Zak <kzak@redhat.com> | 2024-05-01 21:17:52 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2024-05-01 21:17:52 +0200 |
commit | 3f0473ae211b3ba98d55129b1d468b7feeb9cfb5 (patch) | |
tree | c555ec59c70443cd260893d3725fcc1227378427 | |
parent | a974a852278ea5c3a835d4930277025bd4e33675 (diff) | |
parent | 1c33c715b926f82908ae75f19c35baf42da9e05b (diff) | |
download | util-linux-3f0473ae211b3ba98d55129b1d468b7feeb9cfb5.tar.gz |
Merge branch 'lsfd/fcntl' of https://github.com/t-8ch/util-linux
* 'lsfd/fcntl' of https://github.com/t-8ch/util-linux:
lsfd: include buffer.h in decode-file-flags.h
buffer: replace include of c.h with stddef.h
lsfd: move interface of decode-file-flags to header
-rw-r--r-- | include/buffer.h | 2 | ||||
-rw-r--r-- | lsfd-cmd/Makemodule.am | 1 | ||||
-rw-r--r-- | lsfd-cmd/decode-file-flags.c | 11 | ||||
-rw-r--r-- | lsfd-cmd/decode-file-flags.h | 8 | ||||
-rw-r--r-- | lsfd-cmd/file.c | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/include/buffer.h b/include/buffer.h index b122da4eb4..1c1be31122 100644 --- a/include/buffer.h +++ b/include/buffer.h @@ -5,7 +5,7 @@ #ifndef UTIL_LINUX_BUFFER #define UTIL_LINUX_BUFFER -#include "c.h" +#include <stddef.h> struct ul_buffer { char *begin; /* begin of the data */ 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 29c8999cd3..322216c11f 100644 --- a/lsfd-cmd/decode-file-flags.c +++ b/lsfd-cmd/decode-file-flags.c @@ -43,16 +43,7 @@ #include <linux/fcntl.h> -#include <stddef.h> /* for size_t */ -struct ul_buffer; - -void lsfd_decode_file_flags(struct ul_buffer *buf, int flags); - -/* We cannot include buffer.h because buffer.h includes - * /usr/include/fcntl.h indirectly. */ -extern int ul_buffer_is_empty(struct ul_buffer *buf); -extern int ul_buffer_append_data(struct ul_buffer *buf, const char *data, size_t sz); -extern int ul_buffer_append_string(struct ul_buffer *buf, const char *str); +#include "decode-file-flags.h" void lsfd_decode_file_flags(struct ul_buffer *buf, int flags) { diff --git a/lsfd-cmd/decode-file-flags.h b/lsfd-cmd/decode-file-flags.h new file mode 100644 index 0000000000..5c045fd5a4 --- /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 + +#include "buffer.h" + +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); |