a170322083
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 |
||
---|---|---|
.. | ||
Android.mk | ||
event_tag_map.c | ||
fake_log_device.c | ||
logd_write.c | ||
logprint.c | ||
NOTICE |