mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 12:06:12 +00:00
parse: error out on invalid config key
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
4ad78f87c7
commit
44dec7efcc
@ -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,
|
int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
int fd, ret;
|
int fd;
|
||||||
char *buf, *line;
|
char *buf, *line;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
int ret = 0;
|
||||||
char *saveptr = NULL;
|
char *saveptr = NULL;
|
||||||
|
|
||||||
fd = open(file, O_RDONLY | O_CLOEXEC);
|
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);
|
lxc_strmunmap(buf, st.st_size);
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data)
|
int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data)
|
||||||
|
Loading…
Reference in New Issue
Block a user