From 5f9c73912595548d111155a3f8211090fefa214f Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 4 Feb 2016 01:51:41 +0100 Subject: [PATCH] Keep track of errno --- src/damon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/damon.c b/src/damon.c index f9dc1ec..30b2718 100644 --- a/src/damon.c +++ b/src/damon.c @@ -411,11 +411,11 @@ static int _init_config_hosts(DaMon * damon, Config * config, } if((p = realloc(damon->hosts, sizeof(*p) * (damon->hosts_cnt + 1))) == NULL) - return _damon_perror(NULL, 1); + return _damon_perror(NULL, -errno); damon->hosts = p; p = &damon->hosts[damon->hosts_cnt++]; if(_init_config_hosts_host(damon, config, p, h, pos) != 0) - return 1; + return -1; h += pos; pos = 0; } @@ -432,7 +432,7 @@ static int _init_config_hosts_host(DaMon * damon, Config * config, Host * host, host->ifaces = NULL; host->vols = NULL; if((host->hostname = malloc(pos + 1)) == NULL) - return _damon_perror(NULL, 1); + return _damon_perror(NULL, -errno); strncpy(host->hostname, h, pos); host->hostname[pos] = '\0'; #ifdef DEBUG