trace-cmd: Close open fds on exec
trace-cmd: Close open fds on exec

trace-cmd's record mode allows child processes to inherit
tracing-related file descriptors:

$ trace-cmd record -esched: ls -l /proc/self/fd

total 0
lrwx------. 1 root root 64 May 20 12:44 0 -> /dev/pts/11
lrwx------. 1 root root 64 May 20 12:44 1 -> /dev/pts/11
lrwx------. 1 root root 64 May 20 12:44 2 -> /dev/pts/11
lrwx------. 1 root root 64 May 20 12:44 3 -> /sys/kernel/debug/tracing/tracing_on
l-wx------. 1 root root 64 May 20 12:44 4 -> /sys/kernel/debug/tracing/set_ftrace_pid
l-wx------. 1 root root 64 May 20 12:44 5 -> /sys/kernel/debug/tracing/tracing_enabled
lr-x------. 1 root root 64 May 20 12:44 6 -> /proc/31036/fd

This can be problematic for applications (such as lxc) that
interrogate their open file descriptors.

Open these with O_CLOEXEC so they are not inherited.

Signed-off-by: Nathan Lynch <e04de97a81056a5c7ecb3646886e1cc27299320d@pobox.com>
Link: 9497921d7cd4b3e33be9ab1934b9f0a10a30e2bf@orca.stoopid.dyndns.org
Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

bigzz/trace-cmd,bigzz/trace-cmd