From 01eb1fe238371c3a29b22f1d06147f527285539e Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 12 Jul 2020 23:58:21 +0200 Subject: Teach minecctl to delete servers on command --- shared/utils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'shared') 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 -- cgit v1.2.3