Open file descriptors thread-safely on Unix and don't leak them


::open directly is not thread-safe. You need to pass O_CLOEXEC if the OS
supports it. That's the only thread-safe way to open files. qt_safe_open
does that for you.

This patch also implicitly makes all serial devices be opened with
CLOEXEC on all systems, which prevents the file descriptors from leaking
to child processes.

Change-Id: I83a2657fa8d9ccca1b42182bcd83416091066045
Reviewed-by: Laszlo Papp <lpapp@kde.org>
commit691212d9e492b12590d5b7f4e2b24921911d4b17
parent6ce439a6393cd857f3eb9ffeba0ad6594cf4ae63
authorThiago Macieira <thiago.macieira@intel.com>
committerThe Qt Project <gerrit-noreply@qt-project.org>
commit timeWed, 12 Feb 2014 06:11:04 +0100