From 032b853746aabb8c3b82af674fdc783b511569f2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 4 Dec 2021 08:48:45 +0000 Subject: Add opendir_at, prepare for 2.11.1.0 Signed-off-by: Laurent Bercot --- src/libunixonacid/opendir_at.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/libunixonacid/opendir_at.c (limited to 'src/libunixonacid/opendir_at.c') diff --git a/src/libunixonacid/opendir_at.c b/src/libunixonacid/opendir_at.c new file mode 100644 index 0000000..bee971f --- /dev/null +++ b/src/libunixonacid/opendir_at.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include +#include +#include + +DIR *opendir_at (int dfd, char const *name) +{ + DIR *dir ; + int fd = open_readatb(dfd, name) ; + if (fd < 0) return 0 ; + dir = fdopendir(fd) ; + if (!dir) fd_close(fd) ; + return dir ; +} -- cgit v1.2.3