From: Christian Brauner Date: Mon, 8 Oct 2018 20:49:57 +0000 (+0200) Subject: parse: do not mask failed parse X-Git-Tag: lxc-3.1.0~56^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=576fb366f86f5ae33f1893026e948023476586ae;p=thirdparty%2Flxc.git parse: do not mask failed parse Signed-off-by: Christian Brauner --- diff --git a/src/lxc/parse.c b/src/lxc/parse.c index bab842a21..05764b964 100644 --- a/src/lxc/parse.c +++ b/src/lxc/parse.c @@ -111,9 +111,11 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback, void *da } on_error: - ret = lxc_strmunmap(buf, st.st_size); - if (ret < 0) + if (lxc_strmunmap(buf, st.st_size) < 0) { SYSERROR("Failed to unmap config file \"%s\"", file); + if (ret == 0) + ret = -1; + } saved_errno = errno; close(fd);