]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
parse: do not mask failed parse
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 8 Oct 2018 20:49:57 +0000 (22:49 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 8 Oct 2018 20:49:57 +0000 (22:49 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/parse.c

index bab842a215f29e0cda524e2f52a827c1c27c7e71..05764b964482e28ffaef5beab306aa7fc68365a0 100644 (file)
@@ -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);