summaryrefslogtreecommitdiff
path: root/trusty/coverage/coverage_test.cpp
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-03-15 09:45:12 -0700
committerNick Kralevich <nnk@google.com>2013-03-15 09:48:32 -0700
commita1703220834ddeffde5d571cd776ca981e8a42f6 (patch)
treea87f3e5ca1d4f7cc1c3680ef9f1097582b16a0df /trusty/coverage/coverage_test.cpp
parent80dac35023bb7860b7382ca995e19710bd894e7e (diff)
liblog: fix fd leakage
File descriptors remain open across an exec unless FD_CLOEXEC is set. Add O_CLOEXEC to the open() call to prevent file descriptor leakage. In particular, the following program will eventually run out of file descriptors: int main(int argc, char **argv) { printf("===== entering main =====\n"); ALOGW("entering main"); system("ls -l /proc/self/fd/"); execv(argv[0], argv); printf("exec failed\n"); return -1; } Change-Id: I5be43ab3b9f82a05f242b1f586454c50568af388
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions