]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/sd_watchdog nitpicks: simplify
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 24 Jun 2019 12:34:17 +0000 (14:34 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 24 Jun 2019 14:03:37 +0000 (16:03 +0200)
modules/sd_watchdog/sd_watchdog.c

index 9598144677dda35ecdff05a4c30e7409f9e51cd2..bdf6f51f44ea03c93766ebbb3805340855d17a0c 100644 (file)
@@ -23,16 +23,10 @@ static void keepalive_ping(uv_timer_t *timer)
 KR_EXPORT
 int sd_watchdog_init(struct kr_module *module)
 {
-       static kr_layer_api_t layer = { 0 };
-       layer.data = module;
-       module->layer = &layer;
-       module->props = NULL;
-
-       struct watchdog_config *conf = malloc(sizeof(*conf));
+       struct watchdog_config *conf = calloc(1, sizeof(*conf));
        if (!conf) {
                return kr_error(ENOMEM);
        }
-       memset(conf, 0, sizeof(*conf));
        module->data = conf;
 
        /* Check if watchdog is enabled */