{"action":"created","comment":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/77023531","id":77023531,"diff_hunk":"@@ -352,125 +352,124 @@ int pp_getaddrinfo(char *name, uint16_t port, struct addrinfo **results)\n \treturn ret;\n }\n \n-int pp_ctrl_init(struct ct_pingpong *ct)\n+static int pp_ctrl_init_client(struct ct_pingpong *ct)\n {\n-\tint ret, err;\n-\tconst char *retp;\n-\tstruct timeval tv;\n-\tstruct addrinfo *results, *rp;\n-\tchar s[INET_ADDRSTRLEN];\n+\tstruct addrinfo *results;\n+\tstruct addrinfo *rp;\n+\tint ret;\n \n-\ttv.tv_sec = 5;\n-\ttv.tv_usec = 0;\n+\tret = pp_getaddrinfo(ct->opts.dst_addr, ct->ctrl_port, &results);\n+\tif (ret)\n+\t\treturn ret;\n \n-\tPP_DEBUG(\"Initializing control messages\\n\");\n+\tfor (rp = results; rp; rp = rp->ai_next) {\n+\t\tct->ctrl_connfd = socket(rp->ai_family, rp->ai_socktype,\n+\t\t\t\t\t rp->ai_protocol);\n+\t\tif (ct->ctrl_connfd == -1)\n+\t\t\tcontinue;\n \n-\tif (ct->opts.dst_addr) {\n-\t\tret =\n-\t\t    pp_getaddrinfo(ct->opts.dst_addr, ct->ctrl_port, &results);\n-\t\tif (ret != 0)\n-\t\t\treturn ret;\n-\n-\t\tfor (rp = results; rp != NULL; rp = rp->ai_next) {\n-\t\t\tct->ctrl_connfd = socket(rp->ai_family, rp->ai_socktype,\n-\t\t\t\t\t\t rp->ai_protocol);\n-\t\t\tif (ct->ctrl_connfd == -1)\n-\t\t\t\tcontinue;\n-\n-\t\t\tmemset(&ct->ctrl_addr, '\\0', sizeof(ct->ctrl_addr));\n-\t\t\tct->ctrl_addr.sin_family = AF_INET;\n-\t\t\tct->ctrl_addr.sin_addr.s_addr =\n-\t\t\t    ((struct sockaddr_in *)rp->ai_addr)\n-\t\t\t\t->sin_addr.s_addr;\n-\t\t\tct->ctrl_addr.sin_port = htons(ct->ctrl_port);\n-\n-\t\t\tretp = inet_ntop(\n-\t\t\t    AF_INET,\n-\t\t\t    (const void *)&ct->ctrl_addr.sin_addr.s_addr, s,\n-\t\t\t    INET_ADDRSTRLEN);\n-\t\t\tif (retp == NULL) {\n-\t\t\t\terr = -errno;\n-\t\t\t\tPP_PRINTERR(\"inet_ntop\", err);\n-\t\t\t\treturn err;\n-\t\t\t}\n-\t\t\tPP_DEBUG(\"CLIENT: connecting to <%s> (%s)\\n\",\n-\t\t\t\t ct->opts.dst_addr, s);\n-\t\t\tret = connect(ct->ctrl_connfd,\n-\t\t\t\t      (struct sockaddr *)&ct->ctrl_addr,\n-\t\t\t\t      sizeof(ct->ctrl_addr));\n-\t\t\tif (ret == -1) {\n-\t\t\t\terr = -errno;\n-\t\t\t\tclose(ct->ctrl_connfd);\n-\t\t\t\tcontinue;\n-\t\t\t}\n+\t\tret = connect(ct->ctrl_connfd, rp->ai_addr, rp->ai_addrlen);\n+\t\tif (ret != -1)\n \t\t\tbreak;\n-\t\t}\n \n-\t\tfreeaddrinfo(results);\n+\t\tclose(ct->ctrl_connfd);\n+\t}\n \n-\t\tif (!rp || ct->ctrl_connfd == -1) {\n-\t\t\terr = -errno;\n-\t\t\tPP_PRINTERR(\"getaddrinfo/socket/connect\", err);\n-\t\t\treturn err;\n-\t\t}\n+\tret = -errno;\n+\tfreeaddrinfo(results);\n \n-\t\tPP_DEBUG(\"CLIENT: connected\\n\");\n+\tif (!rp) {\n+\t\tPP_PRINTERR(\"getaddrinfo/socket/connect\", ret);","path":"util/pingpong.c","position":null,"original_position":102,"commit_id":"79744d32ba07542914a13510a070d45fc96633dc","original_commit_id":"cdcca72c48e9c882483ee4cf86c19fb6db52d857","user":{"login":"jsquyres","id":617316,"avatar_url":"https://avatars.githubusercontent.com/u/617316?v=3","gravatar_id":"","url":"https://api.github.com/users/jsquyres","html_url":"https://github.com/jsquyres","followers_url":"https://api.github.com/users/jsquyres/followers","following_url":"https://api.github.com/users/jsquyres/following{/other_user}","gists_url":"https://api.github.com/users/jsquyres/gists{/gist_id}","starred_url":"https://api.github.com/users/jsquyres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsquyres/subscriptions","organizations_url":"https://api.github.com/users/jsquyres/orgs","repos_url":"https://api.github.com/users/jsquyres/repos","events_url":"https://api.github.com/users/jsquyres/events{/privacy}","received_events_url":"https://api.github.com/users/jsquyres/received_events","type":"User","site_admin":false},"body":"getaddrinfo errors are returned earlier","created_at":"2016-08-31T16:37:25Z","updated_at":"2016-08-31T16:37:25Z","html_url":"https://github.com/ofiwg/libfabric/pull/2301#discussion_r77023531","pull_request_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301","_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments/77023531"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/2301#discussion_r77023531"},"pull_request":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301"}}},"pull_request":{"url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301","id":83218326,"html_url":"https://github.com/ofiwg/libfabric/pull/2301","diff_url":"https://github.com/ofiwg/libfabric/pull/2301.diff","patch_url":"https://github.com/ofiwg/libfabric/pull/2301.patch","issue_url":"https://api.github.com/repos/ofiwg/libfabric/issues/2301","number":2301,"state":"open","locked":false,"title":"util/pingpong.c: Miscellaneous fixes","user":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"body":"We didn't get to finish running `checkpatch.pl` on `util/pingpong.c` before it got merged. This set of changes does three things:\r\n\r\n- Change `fi_pingpong` so that it requests version 1.4 of libfabric.\r\n- Style changes to comply with `checkpatch.pl`.\r\n- Avoids using `FI_SOURCE` if no `node` and `service` parameter are set. The `fi_pingpong` utility was designed to avoid using the `node` and `service` parameters when calling `fi_getinfo`.","created_at":"2016-08-30T07:05:34Z","updated_at":"2016-08-31T16:37:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04c3c89426bbd26b8714e87cb234bdc35de3598f","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ofiwg/libfabric/milestones/13","html_url":"https://github.com/ofiwg/libfabric/milestones/release%201.4.0","labels_url":"https://api.github.com/repos/ofiwg/libfabric/milestones/13/labels","id":1671739,"number":13,"title":"release 1.4.0","description":"","creator":{"login":"jsquyres","id":617316,"avatar_url":"https://avatars.githubusercontent.com/u/617316?v=3","gravatar_id":"","url":"https://api.github.com/users/jsquyres","html_url":"https://github.com/jsquyres","followers_url":"https://api.github.com/users/jsquyres/followers","following_url":"https://api.github.com/users/jsquyres/following{/other_user}","gists_url":"https://api.github.com/users/jsquyres/gists{/gist_id}","starred_url":"https://api.github.com/users/jsquyres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsquyres/subscriptions","organizations_url":"https://api.github.com/users/jsquyres/orgs","repos_url":"https://api.github.com/users/jsquyres/repos","events_url":"https://api.github.com/users/jsquyres/events{/privacy}","received_events_url":"https://api.github.com/users/jsquyres/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":101,"state":"open","created_at":"2016-03-29T12:35:33Z","updated_at":"2016-08-30T16:19:20Z","due_on":"2016-09-30T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301/commits","review_comments_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301/comments","review_comment_url":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/issues/2301/comments","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/79744d32ba07542914a13510a070d45fc96633dc","head":{"label":"bturrubiates:pr/pingpong-fixes","ref":"pr/pingpong-fixes","sha":"79744d32ba07542914a13510a070d45fc96633dc","user":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"repo":{"id":29930238,"name":"libfabric","full_name":"bturrubiates/libfabric","owner":{"login":"bturrubiates","id":2322856,"avatar_url":"https://avatars.githubusercontent.com/u/2322856?v=3","gravatar_id":"","url":"https://api.github.com/users/bturrubiates","html_url":"https://github.com/bturrubiates","followers_url":"https://api.github.com/users/bturrubiates/followers","following_url":"https://api.github.com/users/bturrubiates/following{/other_user}","gists_url":"https://api.github.com/users/bturrubiates/gists{/gist_id}","starred_url":"https://api.github.com/users/bturrubiates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bturrubiates/subscriptions","organizations_url":"https://api.github.com/users/bturrubiates/orgs","repos_url":"https://api.github.com/users/bturrubiates/repos","events_url":"https://api.github.com/users/bturrubiates/events{/privacy}","received_events_url":"https://api.github.com/users/bturrubiates/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bturrubiates/libfabric","description":"Open Fabric Interfaces","fork":true,"url":"https://api.github.com/repos/bturrubiates/libfabric","forks_url":"https://api.github.com/repos/bturrubiates/libfabric/forks","keys_url":"https://api.github.com/repos/bturrubiates/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bturrubiates/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bturrubiates/libfabric/teams","hooks_url":"https://api.github.com/repos/bturrubiates/libfabric/hooks","issue_events_url":"https://api.github.com/repos/bturrubiates/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/bturrubiates/libfabric/events","assignees_url":"https://api.github.com/repos/bturrubiates/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/bturrubiates/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/bturrubiates/libfabric/tags","blobs_url":"https://api.github.com/repos/bturrubiates/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bturrubiates/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bturrubiates/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/bturrubiates/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bturrubiates/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/bturrubiates/libfabric/languages","stargazers_url":"https://api.github.com/repos/bturrubiates/libfabric/stargazers","contributors_url":"https://api.github.com/repos/bturrubiates/libfabric/contributors","subscribers_url":"https://api.github.com/repos/bturrubiates/libfabric/subscribers","subscription_url":"https://api.github.com/repos/bturrubiates/libfabric/subscription","commits_url":"https://api.github.com/repos/bturrubiates/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/bturrubiates/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/bturrubiates/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/bturrubiates/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/bturrubiates/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/bturrubiates/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bturrubiates/libfabric/merges","archive_url":"https://api.github.com/repos/bturrubiates/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bturrubiates/libfabric/downloads","issues_url":"https://api.github.com/repos/bturrubiates/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/bturrubiates/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/bturrubiates/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/bturrubiates/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bturrubiates/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/bturrubiates/libfabric/releases{/id}","deployments_url":"https://api.github.com/repos/bturrubiates/libfabric/deployments","created_at":"2015-01-27T19:13:34Z","updated_at":"2016-03-10T00:41:07Z","pushed_at":"2016-08-31T05:50:13Z","git_url":"git://github.com/bturrubiates/libfabric.git","ssh_url":"git@github.com:bturrubiates/libfabric.git","clone_url":"https://github.com/bturrubiates/libfabric.git","svn_url":"https://github.com/bturrubiates/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":12804,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ofiwg:master","ref":"master","sha":"a11c0fcb1cd35b2219272c50ffac4f9368f8dfe0","user":{"login":"ofiwg","id":8459445,"avatar_url":"https://avatars.githubusercontent.com/u/8459445?v=3","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"repo":{"id":22996097,"name":"libfabric","full_name":"ofiwg/libfabric","owner":{"login":"ofiwg","id":8459445,"avatar_url":"https://avatars.githubusercontent.com/u/8459445?v=3","gravatar_id":"","url":"https://api.github.com/users/ofiwg","html_url":"https://github.com/ofiwg","followers_url":"https://api.github.com/users/ofiwg/followers","following_url":"https://api.github.com/users/ofiwg/following{/other_user}","gists_url":"https://api.github.com/users/ofiwg/gists{/gist_id}","starred_url":"https://api.github.com/users/ofiwg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofiwg/subscriptions","organizations_url":"https://api.github.com/users/ofiwg/orgs","repos_url":"https://api.github.com/users/ofiwg/repos","events_url":"https://api.github.com/users/ofiwg/events{/privacy}","received_events_url":"https://api.github.com/users/ofiwg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ofiwg/libfabric","description":"Open Fabric Interfaces","fork":false,"url":"https://api.github.com/repos/ofiwg/libfabric","forks_url":"https://api.github.com/repos/ofiwg/libfabric/forks","keys_url":"https://api.github.com/repos/ofiwg/libfabric/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ofiwg/libfabric/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ofiwg/libfabric/teams","hooks_url":"https://api.github.com/repos/ofiwg/libfabric/hooks","issue_events_url":"https://api.github.com/repos/ofiwg/libfabric/issues/events{/number}","events_url":"https://api.github.com/repos/ofiwg/libfabric/events","assignees_url":"https://api.github.com/repos/ofiwg/libfabric/assignees{/user}","branches_url":"https://api.github.com/repos/ofiwg/libfabric/branches{/branch}","tags_url":"https://api.github.com/repos/ofiwg/libfabric/tags","blobs_url":"https://api.github.com/repos/ofiwg/libfabric/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ofiwg/libfabric/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ofiwg/libfabric/git/refs{/sha}","trees_url":"https://api.github.com/repos/ofiwg/libfabric/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ofiwg/libfabric/statuses/{sha}","languages_url":"https://api.github.com/repos/ofiwg/libfabric/languages","stargazers_url":"https://api.github.com/repos/ofiwg/libfabric/stargazers","contributors_url":"https://api.github.com/repos/ofiwg/libfabric/contributors","subscribers_url":"https://api.github.com/repos/ofiwg/libfabric/subscribers","subscription_url":"https://api.github.com/repos/ofiwg/libfabric/subscription","commits_url":"https://api.github.com/repos/ofiwg/libfabric/commits{/sha}","git_commits_url":"https://api.github.com/repos/ofiwg/libfabric/git/commits{/sha}","comments_url":"https://api.github.com/repos/ofiwg/libfabric/comments{/number}","issue_comment_url":"https://api.github.com/repos/ofiwg/libfabric/issues/comments{/number}","contents_url":"https://api.github.com/repos/ofiwg/libfabric/contents/{+path}","compare_url":"https://api.github.com/repos/ofiwg/libfabric/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ofiwg/libfabric/merges","archive_url":"https://api.github.com/repos/ofiwg/libfabric/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ofiwg/libfabric/downloads","issues_url":"https://api.github.com/repos/ofiwg/libfabric/issues{/number}","pulls_url":"https://api.github.com/repos/ofiwg/libfabric/pulls{/number}","milestones_url":"https://api.github.com/repos/ofiwg/libfabric/milestones{/number}","notifications_url":"https://api.github.com/repos/ofiwg/libfabric/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ofiwg/libfabric/labels{/name}","releases_url":"https://api.github.com/repos/ofiwg/libfabric/releases{/id}","deployments_url":"https://api.github.com/repos/ofiwg/libfabric/deployments","created_at":"2014-08-15T16:45:53Z","updated_at":"2016-08-10T19:24:12Z","pushed_at":"2016-08-31T15:01:19Z","git_url":"git://github.com/ofiwg/libfabric.git","ssh_url":"git@github.com:ofiwg/libfabric.git","clone_url":"https://github.com/ofiwg/libfabric.git","svn_url":"https://github.com/ofiwg/libfabric","homepage":"http://ofiwg.github.io/libfabric/","size":13923,"stargazers_count":74,"watchers_count":74,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":76,"mirror_url":null,"open_issues_count":85,"forks":76,"open_issues":85,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301"},"html":{"href":"https://github.com/ofiwg/libfabric/pull/2301"},"issue":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/2301"},"comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/issues/2301/comments"},"review_comments":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301/comments"},"review_comment":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ofiwg/libfabric/pulls/2301/commits"},"statuses":{"href":"https://api.github.com/repos/ofiwg/libfabric/statuses/79744d32ba07542914a13510a070d45fc96633dc"}}}}
{"actor":{"display_login":"jsquyres"}}