diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-11-29 15:29:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-11-29 15:32:47 +0100 |
commit | 5f5865f0ad8069ae01119e34c048a91eb5057143 (patch) | |
tree | 5a3a77e6251230a53371511b066e1427e8d92986 /src/basic/fd-util.h | |
parent | Merge pull request #25385 from drvink/main (diff) | |
download | systemd-5f5865f0ad8069ae01119e34c048a91eb5057143.tar.xz systemd-5f5865f0ad8069ae01119e34c048a91eb5057143.zip |
fd-util: add new helper fd_reopen_conditional()
This is a wrapper around fd_reopen() that will reopen an fd if the
F_GETFL flags indicate this is necessary, and otherwise not.
This is useful for various utility calls that shall be able to operate
on O_PATH and without it, and might need to convert between the two
depending on what's passed in.
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r-- | src/basic/fd-util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index 29c7d86f27..fbaa458613 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -108,6 +108,7 @@ static inline int make_null_stdio(void) { }) int fd_reopen(int fd, int flags); +int fd_reopen_condition(int fd, int flags, int mask, int *ret_new_fd); int read_nr_open(void); int fd_get_diskseq(int fd, uint64_t *ret); |