summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 434f311e71..5df78344aa 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3333,6 +3333,10 @@ bool null_or_empty(struct stat *st) {
return false;
}
+DIR *xopendirat(int fd, const char *name) {
+ return fdopendir(openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
+}
+
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",