]> git.proxmox.com Git - mirror_lxc.git/commitdiff
parse: error out on invalid config key
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 26 Feb 2018 13:03:00 +0000 (14:03 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 26 Feb 2018 13:03:00 +0000 (14:03 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/parse.c

index fba250683b74887ef212fa072961eb12034bda09..4a0df1863ea7b2e5dd08092961924688e0443ff9 100644 (file)
@@ -67,9 +67,10 @@ int lxc_strmunmap(void *addr, size_t length)
 int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback,
                                void *data)
 {
-       int fd, ret;
+       int fd;
        char *buf, *line;
        struct stat st;
+       int ret = 0;
        char *saveptr = NULL;
 
        fd = open(file, O_RDONLY | O_CLOEXEC);
@@ -105,7 +106,7 @@ int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback,
 
        lxc_strmunmap(buf, st.st_size);
        close(fd);
-       return 0;
+       return ret;
 }
 
 int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data)