{"action":"created","issue":{"url":"https://api.github.com/repos/libuv/libuv/issues/743","repository_url":"https://api.github.com/repos/libuv/libuv","labels_url":"https://api.github.com/repos/libuv/libuv/issues/743/labels{/name}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/743/comments","events_url":"https://api.github.com/repos/libuv/libuv/issues/743/events","html_url":"https://github.com/libuv/libuv/pull/743","id":137828862,"number":743,"title":"unix,linux: set close-on-exec on file handles","user":{"login":"kthelgason","id":2563784,"avatar_url":"https://avatars.githubusercontent.com/u/2563784?v=3","gravatar_id":"","url":"https://api.github.com/users/kthelgason","html_url":"https://github.com/kthelgason","followers_url":"https://api.github.com/users/kthelgason/followers","following_url":"https://api.github.com/users/kthelgason/following{/other_user}","gists_url":"https://api.github.com/users/kthelgason/gists{/gist_id}","starred_url":"https://api.github.com/users/kthelgason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kthelgason/subscriptions","organizations_url":"https://api.github.com/users/kthelgason/orgs","repos_url":"https://api.github.com/users/kthelgason/repos","events_url":"https://api.github.com/users/kthelgason/events{/privacy}","received_events_url":"https://api.github.com/users/kthelgason/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-03-02T10:01:24Z","updated_at":"2016-03-04T10:24:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/743","html_url":"https://github.com/libuv/libuv/pull/743","diff_url":"https://github.com/libuv/libuv/pull/743.diff","patch_url":"https://github.com/libuv/libuv/pull/743.patch"},"body":"This PR removes calls to `fopen` in `src/linux-core.c` and replaces them with the function `uv__open_file` added here as well. The purpose of this is to make sure all open file handles have close-on-exec set.\r\n\r\nDescribed further in #736 opened by @bnoordhuis.\r\n\r\nTested on OS X 10.11.2 and Linux 4.4.1-2 both on x86_64\r\n\r\nSome considerations:\r\n1: `UV__O_CLOEXEC` is probably not defined for some platforms, I will have to wait for CI to see\r\n2: `uv__open_file` currently always opens files as read-only. This could be changed but would require parsing mode string to get `open(2)` flags, and is not currently necessary.\r\n3: `CONTRIBUTING.md` states that declarations for unix-specific code go in `include/uv-unix.h`. However I saw no function declarations in that file and noticed that other functions in `src/unix/core.c` were declared in `uv-common.h` so I did that as well, perhaps that is a mistake."},"comment":{"url":"https://api.github.com/repos/libuv/libuv/issues/comments/192222565","html_url":"https://github.com/libuv/libuv/pull/743#issuecomment-192222565","issue_url":"https://api.github.com/repos/libuv/libuv/issues/743","id":192222565,"user":{"login":"kthelgason","id":2563784,"avatar_url":"https://avatars.githubusercontent.com/u/2563784?v=3","gravatar_id":"","url":"https://api.github.com/users/kthelgason","html_url":"https://github.com/kthelgason","followers_url":"https://api.github.com/users/kthelgason/followers","following_url":"https://api.github.com/users/kthelgason/following{/other_user}","gists_url":"https://api.github.com/users/kthelgason/gists{/gist_id}","starred_url":"https://api.github.com/users/kthelgason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kthelgason/subscriptions","organizations_url":"https://api.github.com/users/kthelgason/orgs","repos_url":"https://api.github.com/users/kthelgason/repos","events_url":"https://api.github.com/users/kthelgason/events{/privacy}","received_events_url":"https://api.github.com/users/kthelgason/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T10:24:16Z","updated_at":"2016-03-04T10:24:16Z","body":"@bnoordhuis rebased."}}