{"action":"closed","number":472,"pull_request":{"url":"https://api.github.com/repos/rust-lang/libc/pulls/472","id":97669381,"html_url":"https://github.com/rust-lang/libc/pull/472","diff_url":"https://github.com/rust-lang/libc/pull/472.diff","patch_url":"https://github.com/rust-lang/libc/pull/472.patch","issue_url":"https://api.github.com/repos/rust-lang/libc/issues/472","number":472,"state":"closed","locked":false,"title":"When checking the status from waitpid on a kill -STOP <child_pid> WIFSIGNALED returns true","user":{"login":"BrandonSchaefer","id":761611,"avatar_url":"https://avatars.githubusercontent.com/u/761611?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonSchaefer","html_url":"https://github.com/BrandonSchaefer","followers_url":"https://api.github.com/users/BrandonSchaefer/followers","following_url":"https://api.github.com/users/BrandonSchaefer/following{/other_user}","gists_url":"https://api.github.com/users/BrandonSchaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonSchaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonSchaefer/subscriptions","organizations_url":"https://api.github.com/users/BrandonSchaefer/orgs","repos_url":"https://api.github.com/users/BrandonSchaefer/repos","events_url":"https://api.github.com/users/BrandonSchaefer/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonSchaefer/received_events","type":"User","site_admin":false},"body":"Currently in WIFSIGNALED rust is doing:\r\n(status & 0x7f) + 1\r\nwhere status is i32\r\n\r\nAs defined in /usr/include/x86_64-linux-gnu/bits/waitstatus.h\r\n#define __WIFSIGNALED(status) \\\r\n  (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)\r\n\r\nHere is an example of the issue:\r\nhttp://paste2.org/fXc8BxJ0\r\n\r\nRun it, and it'll print the child pid then:\r\nkill -STOP <child_pid>\r\n\r\nExpect:\r\n  Stopped by signal print statement\r\nResults:\r\n  Killed by signal print statement\r\n\r\nUsing the i32, it wont overflow leaving you with 128 returning true, using the waitstatus define you'll end up with -64 (since it shifts 1 right) which would return false. Though the C version shifts right once not really sure *why* but theres most likely a reason somewhere.\r\n\r\nFor the fix, just cast to i8 (signed char pretty much) as the C version is doing.\r\n\r\nRUNNING ALL TESTS\r\nPASSED 7356 tests","created_at":"2016-12-13T01:20:10Z","updated_at":"2016-12-13T04:20:54Z","closed_at":"2016-12-13T04:20:54Z","merged_at":"2016-12-13T04:20:54Z","merge_commit_sha":"9f6f374a7c77475c61565b755a4dbfdc99657961","assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/libc/pulls/472/commits","review_comments_url":"https://api.github.com/repos/rust-lang/libc/pulls/472/comments","review_comment_url":"https://api.github.com/repos/rust-lang/libc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/libc/issues/472/comments","statuses_url":"https://api.github.com/repos/rust-lang/libc/statuses/9f6f374a7c77475c61565b755a4dbfdc99657961","head":{"label":"BrandonSchaefer:wifsignaled-fix","ref":"wifsignaled-fix","sha":"9f6f374a7c77475c61565b755a4dbfdc99657961","user":{"login":"BrandonSchaefer","id":761611,"avatar_url":"https://avatars.githubusercontent.com/u/761611?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonSchaefer","html_url":"https://github.com/BrandonSchaefer","followers_url":"https://api.github.com/users/BrandonSchaefer/followers","following_url":"https://api.github.com/users/BrandonSchaefer/following{/other_user}","gists_url":"https://api.github.com/users/BrandonSchaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonSchaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonSchaefer/subscriptions","organizations_url":"https://api.github.com/users/BrandonSchaefer/orgs","repos_url":"https://api.github.com/users/BrandonSchaefer/repos","events_url":"https://api.github.com/users/BrandonSchaefer/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonSchaefer/received_events","type":"User","site_admin":false},"repo":{"id":76307947,"name":"libc","full_name":"BrandonSchaefer/libc","owner":{"login":"BrandonSchaefer","id":761611,"avatar_url":"https://avatars.githubusercontent.com/u/761611?v=3","gravatar_id":"","url":"https://api.github.com/users/BrandonSchaefer","html_url":"https://github.com/BrandonSchaefer","followers_url":"https://api.github.com/users/BrandonSchaefer/followers","following_url":"https://api.github.com/users/BrandonSchaefer/following{/other_user}","gists_url":"https://api.github.com/users/BrandonSchaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonSchaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonSchaefer/subscriptions","organizations_url":"https://api.github.com/users/BrandonSchaefer/orgs","repos_url":"https://api.github.com/users/BrandonSchaefer/repos","events_url":"https://api.github.com/users/BrandonSchaefer/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonSchaefer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BrandonSchaefer/libc","description":"Raw bindings to platform APIs for Rust","fork":true,"url":"https://api.github.com/repos/BrandonSchaefer/libc","forks_url":"https://api.github.com/repos/BrandonSchaefer/libc/forks","keys_url":"https://api.github.com/repos/BrandonSchaefer/libc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrandonSchaefer/libc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrandonSchaefer/libc/teams","hooks_url":"https://api.github.com/repos/BrandonSchaefer/libc/hooks","issue_events_url":"https://api.github.com/repos/BrandonSchaefer/libc/issues/events{/number}","events_url":"https://api.github.com/repos/BrandonSchaefer/libc/events","assignees_url":"https://api.github.com/repos/BrandonSchaefer/libc/assignees{/user}","branches_url":"https://api.github.com/repos/BrandonSchaefer/libc/branches{/branch}","tags_url":"https://api.github.com/repos/BrandonSchaefer/libc/tags","blobs_url":"https://api.github.com/repos/BrandonSchaefer/libc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrandonSchaefer/libc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrandonSchaefer/libc/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrandonSchaefer/libc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrandonSchaefer/libc/statuses/{sha}","languages_url":"https://api.github.com/repos/BrandonSchaefer/libc/languages","stargazers_url":"https://api.github.com/repos/BrandonSchaefer/libc/stargazers","contributors_url":"https://api.github.com/repos/BrandonSchaefer/libc/contributors","subscribers_url":"https://api.github.com/repos/BrandonSchaefer/libc/subscribers","subscription_url":"https://api.github.com/repos/BrandonSchaefer/libc/subscription","commits_url":"https://api.github.com/repos/BrandonSchaefer/libc/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrandonSchaefer/libc/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrandonSchaefer/libc/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrandonSchaefer/libc/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrandonSchaefer/libc/contents/{+path}","compare_url":"https://api.github.com/repos/BrandonSchaefer/libc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrandonSchaefer/libc/merges","archive_url":"https://api.github.com/repos/BrandonSchaefer/libc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrandonSchaefer/libc/downloads","issues_url":"https://api.github.com/repos/BrandonSchaefer/libc/issues{/number}","pulls_url":"https://api.github.com/repos/BrandonSchaefer/libc/pulls{/number}","milestones_url":"https://api.github.com/repos/BrandonSchaefer/libc/milestones{/number}","notifications_url":"https://api.github.com/repos/BrandonSchaefer/libc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrandonSchaefer/libc/labels{/name}","releases_url":"https://api.github.com/repos/BrandonSchaefer/libc/releases{/id}","deployments_url":"https://api.github.com/repos/BrandonSchaefer/libc/deployments","created_at":"2016-12-13T00:35:06Z","updated_at":"2016-12-13T00:35:07Z","pushed_at":"2016-12-13T00:47:57Z","git_url":"git://github.com/BrandonSchaefer/libc.git","ssh_url":"git@github.com:BrandonSchaefer/libc.git","clone_url":"https://github.com/BrandonSchaefer/libc.git","svn_url":"https://github.com/BrandonSchaefer/libc","homepage":"","size":10847,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rust-lang:master","ref":"master","sha":"2d86489460ca412178bbcebdfb1109f03043b348","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":29197565,"name":"libc","full_name":"rust-lang/libc","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/libc","description":"Raw bindings to platform APIs for Rust","fork":false,"url":"https://api.github.com/repos/rust-lang/libc","forks_url":"https://api.github.com/repos/rust-lang/libc/forks","keys_url":"https://api.github.com/repos/rust-lang/libc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/libc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/libc/teams","hooks_url":"https://api.github.com/repos/rust-lang/libc/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/libc/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/libc/events","assignees_url":"https://api.github.com/repos/rust-lang/libc/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/libc/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/libc/tags","blobs_url":"https://api.github.com/repos/rust-lang/libc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/libc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/libc/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/libc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/libc/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/libc/languages","stargazers_url":"https://api.github.com/repos/rust-lang/libc/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/libc/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/libc/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/libc/subscription","commits_url":"https://api.github.com/repos/rust-lang/libc/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/libc/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/libc/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/libc/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/libc/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/libc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/libc/merges","archive_url":"https://api.github.com/repos/rust-lang/libc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/libc/downloads","issues_url":"https://api.github.com/repos/rust-lang/libc/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/libc/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/libc/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/libc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/libc/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/libc/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/libc/deployments","created_at":"2015-01-13T15:54:27Z","updated_at":"2016-12-08T03:00:17Z","pushed_at":"2016-12-13T04:20:53Z","git_url":"git://github.com/rust-lang/libc.git","ssh_url":"git@github.com:rust-lang/libc.git","clone_url":"https://github.com/rust-lang/libc.git","svn_url":"https://github.com/rust-lang/libc","homepage":"","size":11024,"stargazers_count":140,"watchers_count":140,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":133,"mirror_url":null,"open_issues_count":17,"forks":133,"open_issues":17,"watchers":140,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/libc/pulls/472"},"html":{"href":"https://github.com/rust-lang/libc/pull/472"},"issue":{"href":"https://api.github.com/repos/rust-lang/libc/issues/472"},"comments":{"href":"https://api.github.com/repos/rust-lang/libc/issues/472/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/libc/pulls/472/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/libc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/libc/pulls/472/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/libc/statuses/9f6f374a7c77475c61565b755a4dbfdc99657961"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"bors","id":3372342,"avatar_url":"https://avatars.githubusercontent.com/u/3372342?v=3","gravatar_id":"","url":"https://api.github.com/users/bors","html_url":"https://github.com/bors","followers_url":"https://api.github.com/users/bors/followers","following_url":"https://api.github.com/users/bors/following{/other_user}","gists_url":"https://api.github.com/users/bors/gists{/gist_id}","starred_url":"https://api.github.com/users/bors/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors/subscriptions","organizations_url":"https://api.github.com/users/bors/orgs","repos_url":"https://api.github.com/users/bors/repos","events_url":"https://api.github.com/users/bors/events{/privacy}","received_events_url":"https://api.github.com/users/bors/received_events","type":"User","site_admin":false},"comments":5,"review_comments":0,"commits":1,"additions":1,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"bors"}}