{"action":"created","comment":{"url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/comments/65253775","id":65253775,"diff_hunk":"@@ -1526,51 +1441,45 @@ break_single_hardlink_at (int           dfd,\n \n   if (stbuf.st_nlink > 1)\n     {\n-      g_autofree char *path_tmp = g_strconcat (path, \".XXXXXX\", NULL);\n-      if (!renametempat (dfd, path, dfd, path_tmp, error))\n-        goto out;\n+      guint count;\n+      gboolean copy_success = FALSE;\n+      char *path_tmp = glnx_strjoina (path, \".XXXXXX\");\n \n-      if (!glnx_file_copy_at (dfd, path_tmp, &stbuf, dfd, path, 0,\n-                              cancellable, error))\n-        goto out;\n-\n-      if (unlinkat (dfd, path_tmp, 0) < 0)\n+      for (count = 0; count < 100; count++)","path":"src/libpriv/rpmostree-core.c","position":118,"original_position":118,"commit_id":"77abe3e36d15a630b054a15a6597e8971117c007","original_commit_id":"77abe3e36d15a630b054a15a6597e8971117c007","user":{"login":"jlebon","id":11934099,"avatar_url":"https://avatars.githubusercontent.com/u/11934099?v=3","gravatar_id":"","url":"https://api.github.com/users/jlebon","html_url":"https://github.com/jlebon","followers_url":"https://api.github.com/users/jlebon/followers","following_url":"https://api.github.com/users/jlebon/following{/other_user}","gists_url":"https://api.github.com/users/jlebon/gists{/gist_id}","starred_url":"https://api.github.com/users/jlebon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlebon/subscriptions","organizations_url":"https://api.github.com/users/jlebon/orgs","repos_url":"https://api.github.com/users/jlebon/repos","events_url":"https://api.github.com/users/jlebon/events{/privacy}","received_events_url":"https://api.github.com/users/jlebon/received_events","type":"User","site_admin":false},"body":"It would still be helpful if libglnx also wrapped this. E.g. a bunch of helpers similar to `glnx_mkdtempat`. But we can do this later.","created_at":"2016-05-31T20:11:39Z","updated_at":"2016-05-31T20:11:39Z","html_url":"https://github.com/projectatomic/rpm-ostree/pull/293#discussion_r65253775","pull_request_url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293","_links":{"self":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/comments/65253775"},"html":{"href":"https://github.com/projectatomic/rpm-ostree/pull/293#discussion_r65253775"},"pull_request":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293"}}},"pull_request":{"url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293","id":71831979,"html_url":"https://github.com/projectatomic/rpm-ostree/pull/293","diff_url":"https://github.com/projectatomic/rpm-ostree/pull/293.diff","patch_url":"https://github.com/projectatomic/rpm-ostree/pull/293.patch","issue_url":"https://api.github.com/repos/projectatomic/rpm-ostree/issues/293","number":293,"state":"open","locked":false,"title":"core: Dedup hardlink/tempfile code","user":{"login":"cgwalters","id":244096,"avatar_url":"https://avatars.githubusercontent.com/u/244096?v=3","gravatar_id":"","url":"https://api.github.com/users/cgwalters","html_url":"https://github.com/cgwalters","followers_url":"https://api.github.com/users/cgwalters/followers","following_url":"https://api.github.com/users/cgwalters/following{/other_user}","gists_url":"https://api.github.com/users/cgwalters/gists{/gist_id}","starred_url":"https://api.github.com/users/cgwalters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgwalters/subscriptions","organizations_url":"https://api.github.com/users/cgwalters/orgs","repos_url":"https://api.github.com/users/cgwalters/repos","events_url":"https://api.github.com/users/cgwalters/events{/privacy}","received_events_url":"https://api.github.com/users/cgwalters/received_events","type":"User","site_admin":false},"body":"I wanted to avoid yet another copy of the \"generate tempfile name\"\r\ncode, so moved it to libglnx:\r\n\r\n  https://github.com/GNOME/libglnx/pull/14\r\n\r\nThis also closes the TODO about deduping the \"break one hardlink\" code\r\nwith the \"break all links in one dir\" code.  The core observation here\r\nis that it's simpler to copy to a tempfile and rename over the\r\nexisting, rather than rename, create, unlink.","created_at":"2016-05-29T16:55:40Z","updated_at":"2016-05-31T20:11:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cccd24ec8f5612951dc1eaff28bca2ac0dd6aab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293/commits","review_comments_url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293/comments","review_comment_url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectatomic/rpm-ostree/issues/293/comments","statuses_url":"https://api.github.com/repos/projectatomic/rpm-ostree/statuses/77abe3e36d15a630b054a15a6597e8971117c007","head":{"label":"cgwalters:core-dedup-hardlink-code","ref":"core-dedup-hardlink-code","sha":"77abe3e36d15a630b054a15a6597e8971117c007","user":{"login":"cgwalters","id":244096,"avatar_url":"https://avatars.githubusercontent.com/u/244096?v=3","gravatar_id":"","url":"https://api.github.com/users/cgwalters","html_url":"https://github.com/cgwalters","followers_url":"https://api.github.com/users/cgwalters/followers","following_url":"https://api.github.com/users/cgwalters/following{/other_user}","gists_url":"https://api.github.com/users/cgwalters/gists{/gist_id}","starred_url":"https://api.github.com/users/cgwalters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgwalters/subscriptions","organizations_url":"https://api.github.com/users/cgwalters/orgs","repos_url":"https://api.github.com/users/cgwalters/repos","events_url":"https://api.github.com/users/cgwalters/events{/privacy}","received_events_url":"https://api.github.com/users/cgwalters/received_events","type":"User","site_admin":false},"repo":{"id":26416044,"name":"rpm-ostree","full_name":"cgwalters/rpm-ostree","owner":{"login":"cgwalters","id":244096,"avatar_url":"https://avatars.githubusercontent.com/u/244096?v=3","gravatar_id":"","url":"https://api.github.com/users/cgwalters","html_url":"https://github.com/cgwalters","followers_url":"https://api.github.com/users/cgwalters/followers","following_url":"https://api.github.com/users/cgwalters/following{/other_user}","gists_url":"https://api.github.com/users/cgwalters/gists{/gist_id}","starred_url":"https://api.github.com/users/cgwalters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgwalters/subscriptions","organizations_url":"https://api.github.com/users/cgwalters/orgs","repos_url":"https://api.github.com/users/cgwalters/repos","events_url":"https://api.github.com/users/cgwalters/events{/privacy}","received_events_url":"https://api.github.com/users/cgwalters/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cgwalters/rpm-ostree","description":"Store RPMs in OSTree repository","fork":true,"url":"https://api.github.com/repos/cgwalters/rpm-ostree","forks_url":"https://api.github.com/repos/cgwalters/rpm-ostree/forks","keys_url":"https://api.github.com/repos/cgwalters/rpm-ostree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cgwalters/rpm-ostree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cgwalters/rpm-ostree/teams","hooks_url":"https://api.github.com/repos/cgwalters/rpm-ostree/hooks","issue_events_url":"https://api.github.com/repos/cgwalters/rpm-ostree/issues/events{/number}","events_url":"https://api.github.com/repos/cgwalters/rpm-ostree/events","assignees_url":"https://api.github.com/repos/cgwalters/rpm-ostree/assignees{/user}","branches_url":"https://api.github.com/repos/cgwalters/rpm-ostree/branches{/branch}","tags_url":"https://api.github.com/repos/cgwalters/rpm-ostree/tags","blobs_url":"https://api.github.com/repos/cgwalters/rpm-ostree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cgwalters/rpm-ostree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cgwalters/rpm-ostree/git/refs{/sha}","trees_url":"https://api.github.com/repos/cgwalters/rpm-ostree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cgwalters/rpm-ostree/statuses/{sha}","languages_url":"https://api.github.com/repos/cgwalters/rpm-ostree/languages","stargazers_url":"https://api.github.com/repos/cgwalters/rpm-ostree/stargazers","contributors_url":"https://api.github.com/repos/cgwalters/rpm-ostree/contributors","subscribers_url":"https://api.github.com/repos/cgwalters/rpm-ostree/subscribers","subscription_url":"https://api.github.com/repos/cgwalters/rpm-ostree/subscription","commits_url":"https://api.github.com/repos/cgwalters/rpm-ostree/commits{/sha}","git_commits_url":"https://api.github.com/repos/cgwalters/rpm-ostree/git/commits{/sha}","comments_url":"https://api.github.com/repos/cgwalters/rpm-ostree/comments{/number}","issue_comment_url":"https://api.github.com/repos/cgwalters/rpm-ostree/issues/comments{/number}","contents_url":"https://api.github.com/repos/cgwalters/rpm-ostree/contents/{+path}","compare_url":"https://api.github.com/repos/cgwalters/rpm-ostree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cgwalters/rpm-ostree/merges","archive_url":"https://api.github.com/repos/cgwalters/rpm-ostree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cgwalters/rpm-ostree/downloads","issues_url":"https://api.github.com/repos/cgwalters/rpm-ostree/issues{/number}","pulls_url":"https://api.github.com/repos/cgwalters/rpm-ostree/pulls{/number}","milestones_url":"https://api.github.com/repos/cgwalters/rpm-ostree/milestones{/number}","notifications_url":"https://api.github.com/repos/cgwalters/rpm-ostree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cgwalters/rpm-ostree/labels{/name}","releases_url":"https://api.github.com/repos/cgwalters/rpm-ostree/releases{/id}","deployments_url":"https://api.github.com/repos/cgwalters/rpm-ostree/deployments","created_at":"2014-11-10T01:32:34Z","updated_at":"2015-02-04T18:58:49Z","pushed_at":"2016-05-31T19:55:18Z","git_url":"git://github.com/cgwalters/rpm-ostree.git","ssh_url":"git@github.com:cgwalters/rpm-ostree.git","clone_url":"https://github.com/cgwalters/rpm-ostree.git","svn_url":"https://github.com/cgwalters/rpm-ostree","homepage":null,"size":2466,"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":"projectatomic:master","ref":"master","sha":"e0637544bdbf45880f4841ba1178ea930ffe7143","user":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"repo":{"id":15369584,"name":"rpm-ostree","full_name":"projectatomic/rpm-ostree","owner":{"login":"projectatomic","id":6852258,"avatar_url":"https://avatars.githubusercontent.com/u/6852258?v=3","gravatar_id":"","url":"https://api.github.com/users/projectatomic","html_url":"https://github.com/projectatomic","followers_url":"https://api.github.com/users/projectatomic/followers","following_url":"https://api.github.com/users/projectatomic/following{/other_user}","gists_url":"https://api.github.com/users/projectatomic/gists{/gist_id}","starred_url":"https://api.github.com/users/projectatomic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectatomic/subscriptions","organizations_url":"https://api.github.com/users/projectatomic/orgs","repos_url":"https://api.github.com/users/projectatomic/repos","events_url":"https://api.github.com/users/projectatomic/events{/privacy}","received_events_url":"https://api.github.com/users/projectatomic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectatomic/rpm-ostree","description":"Store RPMs in OSTree repository, and atomically upgrade from commits","fork":false,"url":"https://api.github.com/repos/projectatomic/rpm-ostree","forks_url":"https://api.github.com/repos/projectatomic/rpm-ostree/forks","keys_url":"https://api.github.com/repos/projectatomic/rpm-ostree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectatomic/rpm-ostree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectatomic/rpm-ostree/teams","hooks_url":"https://api.github.com/repos/projectatomic/rpm-ostree/hooks","issue_events_url":"https://api.github.com/repos/projectatomic/rpm-ostree/issues/events{/number}","events_url":"https://api.github.com/repos/projectatomic/rpm-ostree/events","assignees_url":"https://api.github.com/repos/projectatomic/rpm-ostree/assignees{/user}","branches_url":"https://api.github.com/repos/projectatomic/rpm-ostree/branches{/branch}","tags_url":"https://api.github.com/repos/projectatomic/rpm-ostree/tags","blobs_url":"https://api.github.com/repos/projectatomic/rpm-ostree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectatomic/rpm-ostree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectatomic/rpm-ostree/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectatomic/rpm-ostree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectatomic/rpm-ostree/statuses/{sha}","languages_url":"https://api.github.com/repos/projectatomic/rpm-ostree/languages","stargazers_url":"https://api.github.com/repos/projectatomic/rpm-ostree/stargazers","contributors_url":"https://api.github.com/repos/projectatomic/rpm-ostree/contributors","subscribers_url":"https://api.github.com/repos/projectatomic/rpm-ostree/subscribers","subscription_url":"https://api.github.com/repos/projectatomic/rpm-ostree/subscription","commits_url":"https://api.github.com/repos/projectatomic/rpm-ostree/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectatomic/rpm-ostree/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectatomic/rpm-ostree/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectatomic/rpm-ostree/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectatomic/rpm-ostree/contents/{+path}","compare_url":"https://api.github.com/repos/projectatomic/rpm-ostree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectatomic/rpm-ostree/merges","archive_url":"https://api.github.com/repos/projectatomic/rpm-ostree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectatomic/rpm-ostree/downloads","issues_url":"https://api.github.com/repos/projectatomic/rpm-ostree/issues{/number}","pulls_url":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls{/number}","milestones_url":"https://api.github.com/repos/projectatomic/rpm-ostree/milestones{/number}","notifications_url":"https://api.github.com/repos/projectatomic/rpm-ostree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectatomic/rpm-ostree/labels{/name}","releases_url":"https://api.github.com/repos/projectatomic/rpm-ostree/releases{/id}","deployments_url":"https://api.github.com/repos/projectatomic/rpm-ostree/deployments","created_at":"2013-12-22T03:16:38Z","updated_at":"2016-05-30T00:30:47Z","pushed_at":"2016-05-31T19:55:19Z","git_url":"git://github.com/projectatomic/rpm-ostree.git","ssh_url":"git@github.com:projectatomic/rpm-ostree.git","clone_url":"https://github.com/projectatomic/rpm-ostree.git","svn_url":"https://github.com/projectatomic/rpm-ostree","homepage":"","size":2672,"stargazers_count":123,"watchers_count":123,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":58,"forks":51,"open_issues":58,"watchers":123,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293"},"html":{"href":"https://github.com/projectatomic/rpm-ostree/pull/293"},"issue":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/issues/293"},"comments":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/projectatomic/rpm-ostree/statuses/77abe3e36d15a630b054a15a6597e8971117c007"}}}}
{"actor":{"display_login":"jlebon"}}