let the main() function be responsible for cleanup of tcmu_config
otherwise we'd end up with double frees when exiting main()
@@ -415,13 +415,6 @@ void tcmu_config_destroy(struct tcmu_config *cfg)
cfg = NULL;
}
-static void dyn_config_cleanup(void *arg)
-{
- struct tcmu_config *cfg = arg;
-
- tcmu_config_destroy(cfg);
-}
-
#define BUF_LEN 1024
static void *dyn_config_start(void *arg)
{
@@ -429,8 +422,6 @@ static void *dyn_config_start(void *arg)
int monitor, wd, len;
char buf[BUF_LEN];
- pthread_cleanup_push(dyn_config_cleanup, arg);
-
monitor = inotify_init();
if (monitor == -1) {
tcmu_err("Failed to init inotify %m\n");
@@ -481,8 +472,6 @@ static void *dyn_config_start(void *arg)
}
}
- pthread_cleanup_pop(1);
-
return NULL;
}
