runscriptlet : Flush open fds before fork() to avoid cloning buffers
This is a bug I noticed 2 years ago :
http://www.nabble.com/Re%3A-logging-output-crazy-to11437357.html#a11479679
I thought I fixed it with 57d77eab32c01cd7572a11f76480a3724d09c029
But the bug was still here. Reading man fork, this part caught my attention:
* The child inherits copies of the parent's set of open file
descriptors. Each file descriptor in the child refers to the same open
file description (see open(2)) as the corresponding file descriptor in the
parent. This means that the two descriptors share open file status
flags, current file offset, and signal-driven I/O attributes (see the
description of F_SETOWN and F_SETSIG in fcntl(2)).
Since the open file descriptors are inherited, it is probably a good idea to
flush them before forking.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
0 files changed, 0 insertions, 0 deletions