{"action":"created","issue":{"url":"https://api.github.com/repos/libuv/libuv/issues/304","labels_url":"https://api.github.com/repos/libuv/libuv/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/304/comments","events_url":"https://api.github.com/repos/libuv/libuv/issues/304/events","html_url":"https://github.com/libuv/libuv/issues/304","id":66534486,"number":304,"title":"TTY looks blocked on OSX","user":{"login":"sixmen","id":1409279,"avatar_url":"https://avatars.githubusercontent.com/u/1409279?v=3","gravatar_id":"","url":"https://api.github.com/users/sixmen","html_url":"https://github.com/sixmen","followers_url":"https://api.github.com/users/sixmen/followers","following_url":"https://api.github.com/users/sixmen/following{/other_user}","gists_url":"https://api.github.com/users/sixmen/gists{/gist_id}","starred_url":"https://api.github.com/users/sixmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sixmen/subscriptions","organizations_url":"https://api.github.com/users/sixmen/orgs","repos_url":"https://api.github.com/users/sixmen/repos","events_url":"https://api.github.com/users/sixmen/events{/privacy}","received_events_url":"https://api.github.com/users/sixmen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-06T05:50:23Z","updated_at":"2015-05-04T21:46:30Z","closed_at":null,"body":"From Node.js 0.11.12, REPL sometimes blocked. It does not proceed until I press any key.\r\n\r\nPlease see joyent/node#9310 for more detail.\r\n\r\nWhen I go deeper, it seems that the commit https://github.com/libuv/libuv/commit/b197515367d1a996dca9009483d202b306f9474e occurs this problem.\r\n\r\nI don't understand what the commit exactly means, but I found some odd code.\r\n\r\nThis is the uv__dup2_cloexec's definition.\r\n\r\n```\r\nint uv__dup2_cloexec(int oldfd, int newfd);\r\n```\r\n\r\nIn tty.c\r\n\r\n```\r\nnewfd = uv__open_cloexec(\"/dev/tty\", O_RDWR);\r\nif (newfd == -1)\r\n  return -errno;\r\nr = uv__dup2_cloexec(newfd, fd);\r\nif (r < 0 && r != -EINVAL) {\r\n ...\r\n}\r\n```\r\n\r\nWhen I changed the code to 'uv__dup2_cloexec(fd, newfd)', the problem was gone."},"comment":{"url":"https://api.github.com/repos/libuv/libuv/issues/comments/98857111","html_url":"https://github.com/libuv/libuv/issues/304#issuecomment-98857111","issue_url":"https://api.github.com/repos/libuv/libuv/issues/304","id":98857111,"user":{"login":"secrettriangle","id":1765130,"avatar_url":"https://avatars.githubusercontent.com/u/1765130?v=3","gravatar_id":"","url":"https://api.github.com/users/secrettriangle","html_url":"https://github.com/secrettriangle","followers_url":"https://api.github.com/users/secrettriangle/followers","following_url":"https://api.github.com/users/secrettriangle/following{/other_user}","gists_url":"https://api.github.com/users/secrettriangle/gists{/gist_id}","starred_url":"https://api.github.com/users/secrettriangle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/secrettriangle/subscriptions","organizations_url":"https://api.github.com/users/secrettriangle/orgs","repos_url":"https://api.github.com/users/secrettriangle/repos","events_url":"https://api.github.com/users/secrettriangle/events{/privacy}","received_events_url":"https://api.github.com/users/secrettriangle/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T21:46:30Z","updated_at":"2015-05-04T21:46:30Z","body":"Any progress here?"}}