{"action":"created","comment":{"url":"https://api.github.com/repos/martine/ninja/pulls/comments/29997129","id":29997129,"diff_hunk":"@@ -261,3 +261,17 @@ TEST_F(SubprocessTest, ReadStdin) {\n   ASSERT_EQ(1u, subprocs_.finished_.size());\n }\n #endif  // _WIN32\n+\n+#ifndef _WIN32\n+TEST_F(SubprocessTest, Background) {\n+  time_t before = time(NULL);\n+  Subprocess* subproc = subprocs_.Add(\"echo -n 123; sleep 10s&\");","path":"src/subprocess_test.cc","position":8,"original_position":8,"commit_id":"bbf01baa8aecdebbaac09b6e9aa371e50a0a0184","original_commit_id":"bbf01baa8aecdebbaac09b6e9aa371e50a0a0184","user":{"login":"axw","id":843579,"avatar_url":"https://avatars.githubusercontent.com/u/843579?v=3","gravatar_id":"","url":"https://api.github.com/users/axw","html_url":"https://github.com/axw","followers_url":"https://api.github.com/users/axw/followers","following_url":"https://api.github.com/users/axw/following{/other_user}","gists_url":"https://api.github.com/users/axw/gists{/gist_id}","starred_url":"https://api.github.com/users/axw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axw/subscriptions","organizations_url":"https://api.github.com/users/axw/orgs","repos_url":"https://api.github.com/users/axw/repos","events_url":"https://api.github.com/users/axw/events{/privacy}","received_events_url":"https://api.github.com/users/axw/received_events","type":"User","site_admin":false},"body":"The test will only take 10s if it fails, i.e. without the rest of the patch. The immediate subprocess will exit after backgrounding the sleep task, and so with my patch the exit will be observed and the test will complete immediately.","created_at":"2015-05-09T23:19:37Z","updated_at":"2015-05-09T23:19:37Z","html_url":"https://github.com/martine/ninja/pull/967#discussion_r29997129","pull_request_url":"https://api.github.com/repos/martine/ninja/pulls/967","_links":{"self":{"href":"https://api.github.com/repos/martine/ninja/pulls/comments/29997129"},"html":{"href":"https://github.com/martine/ninja/pull/967#discussion_r29997129"},"pull_request":{"href":"https://api.github.com/repos/martine/ninja/pulls/967"}}},"pull_request":{"url":"https://api.github.com/repos/martine/ninja/pulls/967","id":34894662,"html_url":"https://github.com/martine/ninja/pull/967","diff_url":"https://github.com/martine/ninja/pull/967.diff","patch_url":"https://github.com/martine/ninja/pull/967.patch","issue_url":"https://api.github.com/repos/martine/ninja/issues/967","number":967,"state":"open","locked":false,"title":"Wake ppoll/pselect on SIGCHLD","user":{"login":"axw","id":843579,"avatar_url":"https://avatars.githubusercontent.com/u/843579?v=3","gravatar_id":"","url":"https://api.github.com/users/axw","html_url":"https://github.com/axw","followers_url":"https://api.github.com/users/axw/followers","following_url":"https://api.github.com/users/axw/following{/other_user}","gists_url":"https://api.github.com/users/axw/gists{/gist_id}","starred_url":"https://api.github.com/users/axw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axw/subscriptions","organizations_url":"https://api.github.com/users/axw/orgs","repos_url":"https://api.github.com/users/axw/repos","events_url":"https://api.github.com/users/axw/events{/privacy}","received_events_url":"https://api.github.com/users/axw/received_events","type":"User","site_admin":false},"body":"This change introduces a sigaction for\nSIGCHLD, which causes ppoll and pselect\nto return -1/EINTR if a child dies before\na pipe becomes readable. We then check\nfor dead children, leaving them in a\nwaitable state for Finish.\n\nFixes #965\nObsoletes #966","created_at":"2015-05-07T08:48:32Z","updated_at":"2015-05-09T23:19:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64e2526325f95670ea793e302ba6938ebe1e7b6e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/martine/ninja/pulls/967/commits","review_comments_url":"https://api.github.com/repos/martine/ninja/pulls/967/comments","review_comment_url":"https://api.github.com/repos/martine/ninja/pulls/comments{/number}","comments_url":"https://api.github.com/repos/martine/ninja/issues/967/comments","statuses_url":"https://api.github.com/repos/martine/ninja/statuses/bbf01baa8aecdebbaac09b6e9aa371e50a0a0184","head":{"label":"axw:subprocess-sigchld","ref":"subprocess-sigchld","sha":"bbf01baa8aecdebbaac09b6e9aa371e50a0a0184","user":{"login":"axw","id":843579,"avatar_url":"https://avatars.githubusercontent.com/u/843579?v=3","gravatar_id":"","url":"https://api.github.com/users/axw","html_url":"https://github.com/axw","followers_url":"https://api.github.com/users/axw/followers","following_url":"https://api.github.com/users/axw/following{/other_user}","gists_url":"https://api.github.com/users/axw/gists{/gist_id}","starred_url":"https://api.github.com/users/axw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axw/subscriptions","organizations_url":"https://api.github.com/users/axw/orgs","repos_url":"https://api.github.com/users/axw/repos","events_url":"https://api.github.com/users/axw/events{/privacy}","received_events_url":"https://api.github.com/users/axw/received_events","type":"User","site_admin":false},"repo":{"id":35140598,"name":"ninja","full_name":"axw/ninja","owner":{"login":"axw","id":843579,"avatar_url":"https://avatars.githubusercontent.com/u/843579?v=3","gravatar_id":"","url":"https://api.github.com/users/axw","html_url":"https://github.com/axw","followers_url":"https://api.github.com/users/axw/followers","following_url":"https://api.github.com/users/axw/following{/other_user}","gists_url":"https://api.github.com/users/axw/gists{/gist_id}","starred_url":"https://api.github.com/users/axw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axw/subscriptions","organizations_url":"https://api.github.com/users/axw/orgs","repos_url":"https://api.github.com/users/axw/repos","events_url":"https://api.github.com/users/axw/events{/privacy}","received_events_url":"https://api.github.com/users/axw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/axw/ninja","description":"a small build system with a focus on speed","fork":true,"url":"https://api.github.com/repos/axw/ninja","forks_url":"https://api.github.com/repos/axw/ninja/forks","keys_url":"https://api.github.com/repos/axw/ninja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/axw/ninja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/axw/ninja/teams","hooks_url":"https://api.github.com/repos/axw/ninja/hooks","issue_events_url":"https://api.github.com/repos/axw/ninja/issues/events{/number}","events_url":"https://api.github.com/repos/axw/ninja/events","assignees_url":"https://api.github.com/repos/axw/ninja/assignees{/user}","branches_url":"https://api.github.com/repos/axw/ninja/branches{/branch}","tags_url":"https://api.github.com/repos/axw/ninja/tags","blobs_url":"https://api.github.com/repos/axw/ninja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/axw/ninja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/axw/ninja/git/refs{/sha}","trees_url":"https://api.github.com/repos/axw/ninja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/axw/ninja/statuses/{sha}","languages_url":"https://api.github.com/repos/axw/ninja/languages","stargazers_url":"https://api.github.com/repos/axw/ninja/stargazers","contributors_url":"https://api.github.com/repos/axw/ninja/contributors","subscribers_url":"https://api.github.com/repos/axw/ninja/subscribers","subscription_url":"https://api.github.com/repos/axw/ninja/subscription","commits_url":"https://api.github.com/repos/axw/ninja/commits{/sha}","git_commits_url":"https://api.github.com/repos/axw/ninja/git/commits{/sha}","comments_url":"https://api.github.com/repos/axw/ninja/comments{/number}","issue_comment_url":"https://api.github.com/repos/axw/ninja/issues/comments{/number}","contents_url":"https://api.github.com/repos/axw/ninja/contents/{+path}","compare_url":"https://api.github.com/repos/axw/ninja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/axw/ninja/merges","archive_url":"https://api.github.com/repos/axw/ninja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/axw/ninja/downloads","issues_url":"https://api.github.com/repos/axw/ninja/issues{/number}","pulls_url":"https://api.github.com/repos/axw/ninja/pulls{/number}","milestones_url":"https://api.github.com/repos/axw/ninja/milestones{/number}","notifications_url":"https://api.github.com/repos/axw/ninja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/axw/ninja/labels{/name}","releases_url":"https://api.github.com/repos/axw/ninja/releases{/id}","created_at":"2015-05-06T05:12:56Z","updated_at":"2015-05-06T05:12:56Z","pushed_at":"2015-05-09T15:20:24Z","git_url":"git://github.com/axw/ninja.git","ssh_url":"git@github.com:axw/ninja.git","clone_url":"https://github.com/axw/ninja.git","svn_url":"https://github.com/axw/ninja","homepage":"http://martine.github.com/ninja/","size":8665,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"martine:master","ref":"master","sha":"f0f36ad1c72f6100a8957f035769fda50b69919f","user":{"login":"martine","id":3847,"avatar_url":"https://avatars.githubusercontent.com/u/3847?v=3","gravatar_id":"","url":"https://api.github.com/users/martine","html_url":"https://github.com/martine","followers_url":"https://api.github.com/users/martine/followers","following_url":"https://api.github.com/users/martine/following{/other_user}","gists_url":"https://api.github.com/users/martine/gists{/gist_id}","starred_url":"https://api.github.com/users/martine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martine/subscriptions","organizations_url":"https://api.github.com/users/martine/orgs","repos_url":"https://api.github.com/users/martine/repos","events_url":"https://api.github.com/users/martine/events{/privacy}","received_events_url":"https://api.github.com/users/martine/received_events","type":"User","site_admin":false},"repo":{"id":1335132,"name":"ninja","full_name":"martine/ninja","owner":{"login":"martine","id":3847,"avatar_url":"https://avatars.githubusercontent.com/u/3847?v=3","gravatar_id":"","url":"https://api.github.com/users/martine","html_url":"https://github.com/martine","followers_url":"https://api.github.com/users/martine/followers","following_url":"https://api.github.com/users/martine/following{/other_user}","gists_url":"https://api.github.com/users/martine/gists{/gist_id}","starred_url":"https://api.github.com/users/martine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martine/subscriptions","organizations_url":"https://api.github.com/users/martine/orgs","repos_url":"https://api.github.com/users/martine/repos","events_url":"https://api.github.com/users/martine/events{/privacy}","received_events_url":"https://api.github.com/users/martine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/martine/ninja","description":"a small build system with a focus on speed","fork":false,"url":"https://api.github.com/repos/martine/ninja","forks_url":"https://api.github.com/repos/martine/ninja/forks","keys_url":"https://api.github.com/repos/martine/ninja/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martine/ninja/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martine/ninja/teams","hooks_url":"https://api.github.com/repos/martine/ninja/hooks","issue_events_url":"https://api.github.com/repos/martine/ninja/issues/events{/number}","events_url":"https://api.github.com/repos/martine/ninja/events","assignees_url":"https://api.github.com/repos/martine/ninja/assignees{/user}","branches_url":"https://api.github.com/repos/martine/ninja/branches{/branch}","tags_url":"https://api.github.com/repos/martine/ninja/tags","blobs_url":"https://api.github.com/repos/martine/ninja/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martine/ninja/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martine/ninja/git/refs{/sha}","trees_url":"https://api.github.com/repos/martine/ninja/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martine/ninja/statuses/{sha}","languages_url":"https://api.github.com/repos/martine/ninja/languages","stargazers_url":"https://api.github.com/repos/martine/ninja/stargazers","contributors_url":"https://api.github.com/repos/martine/ninja/contributors","subscribers_url":"https://api.github.com/repos/martine/ninja/subscribers","subscription_url":"https://api.github.com/repos/martine/ninja/subscription","commits_url":"https://api.github.com/repos/martine/ninja/commits{/sha}","git_commits_url":"https://api.github.com/repos/martine/ninja/git/commits{/sha}","comments_url":"https://api.github.com/repos/martine/ninja/comments{/number}","issue_comment_url":"https://api.github.com/repos/martine/ninja/issues/comments{/number}","contents_url":"https://api.github.com/repos/martine/ninja/contents/{+path}","compare_url":"https://api.github.com/repos/martine/ninja/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martine/ninja/merges","archive_url":"https://api.github.com/repos/martine/ninja/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martine/ninja/downloads","issues_url":"https://api.github.com/repos/martine/ninja/issues{/number}","pulls_url":"https://api.github.com/repos/martine/ninja/pulls{/number}","milestones_url":"https://api.github.com/repos/martine/ninja/milestones{/number}","notifications_url":"https://api.github.com/repos/martine/ninja/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martine/ninja/labels{/name}","releases_url":"https://api.github.com/repos/martine/ninja/releases{/id}","created_at":"2011-02-06T19:07:12Z","updated_at":"2015-05-09T16:33:51Z","pushed_at":"2015-05-09T15:20:25Z","git_url":"git://github.com/martine/ninja.git","ssh_url":"git@github.com:martine/ninja.git","clone_url":"https://github.com/martine/ninja.git","svn_url":"https://github.com/martine/ninja","homepage":"http://martine.github.com/ninja/","size":8665,"stargazers_count":1381,"watchers_count":1381,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":242,"mirror_url":null,"open_issues_count":143,"forks":242,"open_issues":143,"watchers":1381,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/martine/ninja/pulls/967"},"html":{"href":"https://github.com/martine/ninja/pull/967"},"issue":{"href":"https://api.github.com/repos/martine/ninja/issues/967"},"comments":{"href":"https://api.github.com/repos/martine/ninja/issues/967/comments"},"review_comments":{"href":"https://api.github.com/repos/martine/ninja/pulls/967/comments"},"review_comment":{"href":"https://api.github.com/repos/martine/ninja/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/martine/ninja/pulls/967/commits"},"statuses":{"href":"https://api.github.com/repos/martine/ninja/statuses/bbf01baa8aecdebbaac09b6e9aa371e50a0a0184"}}}}