summaryrefslogtreecommitdiff
path: root/src/shared/fdset.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/fdset.h')
-rw-r--r--src/shared/fdset.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shared/fdset.h b/src/shared/fdset.h
index a7bd5e2b40..1a26005183 100644
--- a/src/shared/fdset.h
+++ b/src/shared/fdset.h
@@ -22,6 +22,7 @@
***/
#include "set.h"
+#include "util.h"
typedef struct FDSet FDSet;
@@ -47,3 +48,9 @@ int fdset_iterate(FDSet *s, Iterator *i);
#define FDSET_FOREACH(fd, fds, i) \
for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i)))
+
+static inline void fdset_freep(FDSet **fds) {
+ if (*fds)
+ fdset_free(*fds);
+}
+#define _cleanup_fdset_free_ _cleanup_(fdset_freep)