chiark / gitweb /
tmpfiles: integrate kay's directory cleanup code and otherwise beef up tmpfiles quite...
[elogind.git] / src / util.c
index 434f311e71f9cdbbdafe85229fdeb653f0b22965..5df78344aa7d4ada4cc4fa464c3c47db47def932 100644 (file)
@@ -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",