{"action":"created","comment":{"url":"https://api.github.com/repos/ocsigen/lwt/pulls/comments/125342403","pull_request_review_id":47722974,"id":125342403,"diff_hunk":"@@ -1831,19 +1820,21 @@ static void worker_readdir_n(struct job_readdir_n *job)\n {\n     long i;\n     for (i = 0; i < job->count; i++) {\n-        struct dirent *ptr;\n-        int result = readdir_r(job->dir, &job->entries[i], &ptr);\n+        errno = 0;\n+        struct dirent *entry = readdir(job->dir);\n \n         /* An error happened. */\n-        if (result != 0) {\n-            job->error_code = result;\n+        if (entry == NULL && errno != 0) {\n+            job->error_code = errno;\n             return;\n         }\n \n         /* End of directory reached */\n-        if (ptr == NULL) break;\n-    }\n+        if (entry == NULL && errno == 0) break;\n \n+        /* All is good */\n+        job->entries[i] = *entry;","path":"src/unix/lwt_unix_unix.h","position":112,"original_position":112,"commit_id":"e61777e8bb7a32d097efbe977d6c8a87fee2bee5","original_commit_id":"e61777e8bb7a32d097efbe977d6c8a87fee2bee5","user":{"login":"raphael-proust","id":656181,"avatar_url":"https://avatars2.githubusercontent.com/u/656181?v=3","gravatar_id":"","url":"https://api.github.com/users/raphael-proust","html_url":"https://github.com/raphael-proust","followers_url":"https://api.github.com/users/raphael-proust/followers","following_url":"https://api.github.com/users/raphael-proust/following{/other_user}","gists_url":"https://api.github.com/users/raphael-proust/gists{/gist_id}","starred_url":"https://api.github.com/users/raphael-proust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphael-proust/subscriptions","organizations_url":"https://api.github.com/users/raphael-proust/orgs","repos_url":"https://api.github.com/users/raphael-proust/repos","events_url":"https://api.github.com/users/raphael-proust/events{/privacy}","received_events_url":"https://api.github.com/users/raphael-proust/received_events","type":"User","site_admin":false},"body":"I almost want to use`caml_copy_string` there. It sort of breaks the pattern of “`worker` does the C/system part and `result` does the conversion.” And on top of that, I'm not sure what happens if you call `caml_copy_string` and then abandon those values because of an error. Do you need to free them?\r\n\r\nActually… see other comment.\r\n\r\nI see little point in copying the string twice: once in C and then once to convert to OCaml layout. Any opinions about it? Any comments on the paragraph above?","created_at":"2017-07-03T18:42:09Z","updated_at":"2017-07-03T18:42:09Z","html_url":"https://github.com/ocsigen/lwt/pull/430#discussion_r125342403","pull_request_url":"https://api.github.com/repos/ocsigen/lwt/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/ocsigen/lwt/pulls/comments/125342403"},"html":{"href":"https://github.com/ocsigen/lwt/pull/430#discussion_r125342403"},"pull_request":{"href":"https://api.github.com/repos/ocsigen/lwt/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/ocsigen/lwt/pulls/430","id":128496874,"html_url":"https://github.com/ocsigen/lwt/pull/430","diff_url":"https://github.com/ocsigen/lwt/pull/430.diff","patch_url":"https://github.com/ocsigen/lwt/pull/430.patch","issue_url":"https://api.github.com/repos/ocsigen/lwt/issues/430","number":430,"state":"open","locked":false,"title":"Use `readdir` instead of deprecated `readdir_r` to avoid warnings","user":{"login":"raphael-proust","id":656181,"avatar_url":"https://avatars2.githubusercontent.com/u/656181?v=3","gravatar_id":"","url":"https://api.github.com/users/raphael-proust","html_url":"https://github.com/raphael-proust","followers_url":"https://api.github.com/users/raphael-proust/followers","following_url":"https://api.github.com/users/raphael-proust/following{/other_user}","gists_url":"https://api.github.com/users/raphael-proust/gists{/gist_id}","starred_url":"https://api.github.com/users/raphael-proust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphael-proust/subscriptions","organizations_url":"https://api.github.com/users/raphael-proust/orgs","repos_url":"https://api.github.com/users/raphael-proust/repos","events_url":"https://api.github.com/users/raphael-proust/events{/privacy}","received_events_url":"https://api.github.com/users/raphael-proust/received_events","type":"User","site_admin":false},"body":"Fixed all C warning for unix on my machine. I'll have a look at the windows ones (although I'm not sure how much help I'd be there).\r\n\r\nIt passes tests but I don't trust myself and because it's C I don't trust the compiler to shout at me when I'm wrong. A second pair of eyes is definitely welcome.\r\n\r\nI should also probably rebase to avoid a separate commit for cosmetics.","created_at":"2017-07-01T18:27:53Z","updated_at":"2017-07-03T18:42:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb3ca0d3094ccb2c4add9ca77b013f96aab25c6a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ocsigen/lwt/pulls/430/commits","review_comments_url":"https://api.github.com/repos/ocsigen/lwt/pulls/430/comments","review_comment_url":"https://api.github.com/repos/ocsigen/lwt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ocsigen/lwt/issues/430/comments","statuses_url":"https://api.github.com/repos/ocsigen/lwt/statuses/e61777e8bb7a32d097efbe977d6c8a87fee2bee5","head":{"label":"raphael-proust:macro-cleaning","ref":"macro-cleaning","sha":"e61777e8bb7a32d097efbe977d6c8a87fee2bee5","user":{"login":"raphael-proust","id":656181,"avatar_url":"https://avatars2.githubusercontent.com/u/656181?v=3","gravatar_id":"","url":"https://api.github.com/users/raphael-proust","html_url":"https://github.com/raphael-proust","followers_url":"https://api.github.com/users/raphael-proust/followers","following_url":"https://api.github.com/users/raphael-proust/following{/other_user}","gists_url":"https://api.github.com/users/raphael-proust/gists{/gist_id}","starred_url":"https://api.github.com/users/raphael-proust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphael-proust/subscriptions","organizations_url":"https://api.github.com/users/raphael-proust/orgs","repos_url":"https://api.github.com/users/raphael-proust/repos","events_url":"https://api.github.com/users/raphael-proust/events{/privacy}","received_events_url":"https://api.github.com/users/raphael-proust/received_events","type":"User","site_admin":false},"repo":{"id":92591116,"name":"lwt","full_name":"raphael-proust/lwt","owner":{"login":"raphael-proust","id":656181,"avatar_url":"https://avatars2.githubusercontent.com/u/656181?v=3","gravatar_id":"","url":"https://api.github.com/users/raphael-proust","html_url":"https://github.com/raphael-proust","followers_url":"https://api.github.com/users/raphael-proust/followers","following_url":"https://api.github.com/users/raphael-proust/following{/other_user}","gists_url":"https://api.github.com/users/raphael-proust/gists{/gist_id}","starred_url":"https://api.github.com/users/raphael-proust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphael-proust/subscriptions","organizations_url":"https://api.github.com/users/raphael-proust/orgs","repos_url":"https://api.github.com/users/raphael-proust/repos","events_url":"https://api.github.com/users/raphael-proust/events{/privacy}","received_events_url":"https://api.github.com/users/raphael-proust/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/raphael-proust/lwt","description":"Concurrency in OCaml based on promises.","fork":true,"url":"https://api.github.com/repos/raphael-proust/lwt","forks_url":"https://api.github.com/repos/raphael-proust/lwt/forks","keys_url":"https://api.github.com/repos/raphael-proust/lwt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/raphael-proust/lwt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/raphael-proust/lwt/teams","hooks_url":"https://api.github.com/repos/raphael-proust/lwt/hooks","issue_events_url":"https://api.github.com/repos/raphael-proust/lwt/issues/events{/number}","events_url":"https://api.github.com/repos/raphael-proust/lwt/events","assignees_url":"https://api.github.com/repos/raphael-proust/lwt/assignees{/user}","branches_url":"https://api.github.com/repos/raphael-proust/lwt/branches{/branch}","tags_url":"https://api.github.com/repos/raphael-proust/lwt/tags","blobs_url":"https://api.github.com/repos/raphael-proust/lwt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/raphael-proust/lwt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/raphael-proust/lwt/git/refs{/sha}","trees_url":"https://api.github.com/repos/raphael-proust/lwt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/raphael-proust/lwt/statuses/{sha}","languages_url":"https://api.github.com/repos/raphael-proust/lwt/languages","stargazers_url":"https://api.github.com/repos/raphael-proust/lwt/stargazers","contributors_url":"https://api.github.com/repos/raphael-proust/lwt/contributors","subscribers_url":"https://api.github.com/repos/raphael-proust/lwt/subscribers","subscription_url":"https://api.github.com/repos/raphael-proust/lwt/subscription","commits_url":"https://api.github.com/repos/raphael-proust/lwt/commits{/sha}","git_commits_url":"https://api.github.com/repos/raphael-proust/lwt/git/commits{/sha}","comments_url":"https://api.github.com/repos/raphael-proust/lwt/comments{/number}","issue_comment_url":"https://api.github.com/repos/raphael-proust/lwt/issues/comments{/number}","contents_url":"https://api.github.com/repos/raphael-proust/lwt/contents/{+path}","compare_url":"https://api.github.com/repos/raphael-proust/lwt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/raphael-proust/lwt/merges","archive_url":"https://api.github.com/repos/raphael-proust/lwt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/raphael-proust/lwt/downloads","issues_url":"https://api.github.com/repos/raphael-proust/lwt/issues{/number}","pulls_url":"https://api.github.com/repos/raphael-proust/lwt/pulls{/number}","milestones_url":"https://api.github.com/repos/raphael-proust/lwt/milestones{/number}","notifications_url":"https://api.github.com/repos/raphael-proust/lwt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/raphael-proust/lwt/labels{/name}","releases_url":"https://api.github.com/repos/raphael-proust/lwt/releases{/id}","deployments_url":"https://api.github.com/repos/raphael-proust/lwt/deployments","created_at":"2017-05-27T10:16:32Z","updated_at":"2017-05-27T10:16:33Z","pushed_at":"2017-07-01T18:22:48Z","git_url":"git://github.com/raphael-proust/lwt.git","ssh_url":"git@github.com:raphael-proust/lwt.git","clone_url":"https://github.com/raphael-proust/lwt.git","svn_url":"https://github.com/raphael-proust/lwt","homepage":"https://ocsigen.org/lwt/manual/","size":6943,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"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":"ocsigen:master","ref":"master","sha":"dc68c1ba73bb06b46f99c0fc42ed650335662a55","user":{"login":"ocsigen","id":4729424,"avatar_url":"https://avatars2.githubusercontent.com/u/4729424?v=3","gravatar_id":"","url":"https://api.github.com/users/ocsigen","html_url":"https://github.com/ocsigen","followers_url":"https://api.github.com/users/ocsigen/followers","following_url":"https://api.github.com/users/ocsigen/following{/other_user}","gists_url":"https://api.github.com/users/ocsigen/gists{/gist_id}","starred_url":"https://api.github.com/users/ocsigen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocsigen/subscriptions","organizations_url":"https://api.github.com/users/ocsigen/orgs","repos_url":"https://api.github.com/users/ocsigen/repos","events_url":"https://api.github.com/users/ocsigen/events{/privacy}","received_events_url":"https://api.github.com/users/ocsigen/received_events","type":"Organization","site_admin":false},"repo":{"id":11749475,"name":"lwt","full_name":"ocsigen/lwt","owner":{"login":"ocsigen","id":4729424,"avatar_url":"https://avatars2.githubusercontent.com/u/4729424?v=3","gravatar_id":"","url":"https://api.github.com/users/ocsigen","html_url":"https://github.com/ocsigen","followers_url":"https://api.github.com/users/ocsigen/followers","following_url":"https://api.github.com/users/ocsigen/following{/other_user}","gists_url":"https://api.github.com/users/ocsigen/gists{/gist_id}","starred_url":"https://api.github.com/users/ocsigen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocsigen/subscriptions","organizations_url":"https://api.github.com/users/ocsigen/orgs","repos_url":"https://api.github.com/users/ocsigen/repos","events_url":"https://api.github.com/users/ocsigen/events{/privacy}","received_events_url":"https://api.github.com/users/ocsigen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ocsigen/lwt","description":"Concurrency in OCaml based on promises.","fork":false,"url":"https://api.github.com/repos/ocsigen/lwt","forks_url":"https://api.github.com/repos/ocsigen/lwt/forks","keys_url":"https://api.github.com/repos/ocsigen/lwt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ocsigen/lwt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ocsigen/lwt/teams","hooks_url":"https://api.github.com/repos/ocsigen/lwt/hooks","issue_events_url":"https://api.github.com/repos/ocsigen/lwt/issues/events{/number}","events_url":"https://api.github.com/repos/ocsigen/lwt/events","assignees_url":"https://api.github.com/repos/ocsigen/lwt/assignees{/user}","branches_url":"https://api.github.com/repos/ocsigen/lwt/branches{/branch}","tags_url":"https://api.github.com/repos/ocsigen/lwt/tags","blobs_url":"https://api.github.com/repos/ocsigen/lwt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ocsigen/lwt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ocsigen/lwt/git/refs{/sha}","trees_url":"https://api.github.com/repos/ocsigen/lwt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ocsigen/lwt/statuses/{sha}","languages_url":"https://api.github.com/repos/ocsigen/lwt/languages","stargazers_url":"https://api.github.com/repos/ocsigen/lwt/stargazers","contributors_url":"https://api.github.com/repos/ocsigen/lwt/contributors","subscribers_url":"https://api.github.com/repos/ocsigen/lwt/subscribers","subscription_url":"https://api.github.com/repos/ocsigen/lwt/subscription","commits_url":"https://api.github.com/repos/ocsigen/lwt/commits{/sha}","git_commits_url":"https://api.github.com/repos/ocsigen/lwt/git/commits{/sha}","comments_url":"https://api.github.com/repos/ocsigen/lwt/comments{/number}","issue_comment_url":"https://api.github.com/repos/ocsigen/lwt/issues/comments{/number}","contents_url":"https://api.github.com/repos/ocsigen/lwt/contents/{+path}","compare_url":"https://api.github.com/repos/ocsigen/lwt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ocsigen/lwt/merges","archive_url":"https://api.github.com/repos/ocsigen/lwt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ocsigen/lwt/downloads","issues_url":"https://api.github.com/repos/ocsigen/lwt/issues{/number}","pulls_url":"https://api.github.com/repos/ocsigen/lwt/pulls{/number}","milestones_url":"https://api.github.com/repos/ocsigen/lwt/milestones{/number}","notifications_url":"https://api.github.com/repos/ocsigen/lwt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ocsigen/lwt/labels{/name}","releases_url":"https://api.github.com/repos/ocsigen/lwt/releases{/id}","deployments_url":"https://api.github.com/repos/ocsigen/lwt/deployments","created_at":"2013-07-29T20:47:51Z","updated_at":"2017-07-03T12:25:39Z","pushed_at":"2017-07-02T15:19:21Z","git_url":"git://github.com/ocsigen/lwt.git","ssh_url":"git@github.com:ocsigen/lwt.git","clone_url":"https://github.com/ocsigen/lwt.git","svn_url":"https://github.com/ocsigen/lwt","homepage":"https://ocsigen.org/lwt/manual/","size":7164,"stargazers_count":155,"watchers_count":155,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":86,"mirror_url":null,"open_issues_count":78,"forks":86,"open_issues":78,"watchers":155,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ocsigen/lwt/pulls/430"},"html":{"href":"https://github.com/ocsigen/lwt/pull/430"},"issue":{"href":"https://api.github.com/repos/ocsigen/lwt/issues/430"},"comments":{"href":"https://api.github.com/repos/ocsigen/lwt/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/ocsigen/lwt/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/ocsigen/lwt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ocsigen/lwt/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/ocsigen/lwt/statuses/e61777e8bb7a32d097efbe977d6c8a87fee2bee5"}}}}
{"actor":{"display_login":"raphael-proust"}}