diff options
-rw-r--r-- | daemon/augeas.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/daemon/augeas.c b/daemon/augeas.c index 03cba421..83d24ad3 100644 --- a/daemon/augeas.c +++ b/daemon/augeas.c @@ -38,6 +38,17 @@ */ static augeas *aug = NULL; +/* Clean up the augeas handle on daemon exit. */ +static void aug_finalize (void) __attribute__((destructor)); +static void +aug_finalize (void) +{ + if (aug) { + aug_close (aug); + aug = NULL; + } +} + #define NEED_AUG(errcode) \ do { \ if (!aug) { \ |