summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/shared/utils.h b/shared/utils.h
index b6bf51c..2bf7aae 100644
--- a/shared/utils.h
+++ b/shared/utils.h
@@ -188,4 +188,10 @@ static inline void fclosep(FILE **f) {
}
#define _cleanup_fclose_ _cleanup_(fclosep)
+static inline void closedirp(DIR **d) {
+ if (d && *d)
+ closedir(*d);
+}
+#define _cleanup_closedir_ _cleanup_(closedirp)
+
#endif