Merge lp:~akopytov/percona-xtrabackup/bug1210266-2.0 into lp:percona-xtrabackup/2.0

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 580
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1210266-2.0
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 53 lines (+21/-19)
1 file modified
src/xtrabackup.cc (+21/-19)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1210266-2.0
Reviewer Review Type Date Requested Status
George Ormond Lorch III (community) g2 Approve
Review via email: mp+179850@code.launchpad.net
To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) :
review: Approve (g2)
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Should have been a G2 MP.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/xtrabackup.cc'
--- src/xtrabackup.cc 2013-08-10 15:45:25 +0000
+++ src/xtrabackup.cc 2013-08-13 05:43:22 +0000
@@ -5172,29 +5172,31 @@
5172static ibool5172static ibool
5173xb_create_suspend_file(const char *path)5173xb_create_suspend_file(const char *path)
5174{5174{
5175 ibool success;5175 File suspend_file;
5176 os_file_t suspend_file = XB_FILE_UNDEFINED;5176 pid_t pid;
5177 pid_t pid;5177 char buffer[64];
5178 char buffer[64];
51795178
5180 pid = getpid();5179 pid = getpid();
5181 sprintf(buffer, "%d", pid);5180 snprintf(buffer, sizeof(buffer), "%u", (uint) pid);
51825181
5183 msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n", path, pid);5182 msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n",
5184 5183 path, (uint) pid);
5185 suspend_file = xb_file_create_no_error_handling(path, OS_FILE_CREATE,5184
5186 OS_FILE_READ_WRITE,5185 suspend_file = my_create(path, 0, O_WRONLY | O_EXCL | O_NOFOLLOW,
5187 &success);5186 MYF(MY_WME));
51885187
5189 if (success && suspend_file != XB_FILE_UNDEFINED) {5188 if (suspend_file >= 0) {
5190 xb_os_file_write(path, suspend_file, buffer, 0, strlen(buffer));5189 ibool rc;
5191 os_file_close(suspend_file);5190
5192 return(TRUE);5191 rc = my_write(suspend_file, (uchar *) buffer, strlen(buffer),
5192 MYF(MY_WME | MY_NABP)) == 0;
5193
5194 my_close(suspend_file, MYF(MY_WME));
5195 return(rc);
5193 }5196 }
51945197
5195 msg("xtrabackup: Error: failed to create file '%s' with %d\n", path,5198 msg("xtrabackup: Error: failed to create file '%s'\n",
5196 os_file_get_last_error(TRUE));5199 path);
5197
5198 return(FALSE);5200 return(FALSE);
5199}5201}
52005202

Subscribers

People subscribed via source and target branches