fd-util: introduce fd_reopen() helper for reopening an fd

We have the same code for this in place at various locations, let's
unify that. Also, let's repurpose test-fs-util.c as a test for this new
helper cal..
This commit is contained in:
Lennart Poettering
2018-03-29 15:33:12 +02:00
parent c75436067f
commit f2324783ce
4 changed files with 24 additions and 16 deletions
+2
View File
@@ -113,3 +113,5 @@ static inline int make_null_stdio(void) {
(fd) = -1; \
_fd_; \
})
int fd_reopen(int fd, int flags);