Re: [lxc-devel] [PATCH] Ensure that mmap()ed memory is \0-terminated (v3)

2015-09-11 Thread Serge Hallyn
Quoting Christian Brauner (christianvanbrau...@gmail.com): > Use pwrite() to write terminating \0-byte > > This allows us to use standard string handling functions and we can avoid > using > the GNU-extension memmem(). This simplifies removing the container from the > lxc_snapshots file. Wrap str

[lxc-devel] [PATCH] Ensure that mmap()ed memory is \0-terminated (v3)

2015-09-10 Thread Christian Brauner
Use pwrite() to write terminating \0-byte This allows us to use standard string handling functions and we can avoid using the GNU-extension memmem(). This simplifies removing the container from the lxc_snapshots file. Wrap strstr() in a while loop to remove duplicate entries. Signed-off-by: Chris