]> git.ipfire.org Git - thirdparty/lxc.git/commit
utils: fix lxc_p{close,open}() 2170/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 16 Feb 2018 19:02:44 +0000 (20:02 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 16 Feb 2018 19:06:48 +0000 (20:06 +0100)
commit7e50ec0b5f727f3cbc99b2be9189e936857ce44e
treed8e6c327559747188165bb573b75e93092461934
parente99cf4acfd12ec8053497495b937f465c4b1b530
utils: fix lxc_p{close,open}()

If a file descriptor fd is opened by fdopen() and associated with a stream f
will **not** have been dup()ed. This means that fclose(f) will also close the
fd. So never call close(fd) after fdopen(fd) succeeded.
This fixes a double close() Stéphane and I observed when debugging on aarch64
and armf.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/utils.c