Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
daemon: Close augeas handle on exit.
  • Loading branch information
rwmjones committed Jan 24, 2012
1 parent ff2e685 commit 94a7fb9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions daemon/augeas.c
Expand Up @@ -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) { \
Expand Down

0 comments on commit 94a7fb9

Please sign in to comment.