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
1=== modified file 'src/xtrabackup.cc'
2--- src/xtrabackup.cc 2013-08-10 15:45:25 +0000
3+++ src/xtrabackup.cc 2013-08-13 05:43:22 +0000
4@@ -5172,29 +5172,31 @@
5 static ibool
6 xb_create_suspend_file(const char *path)
7 {
8- ibool success;
9- os_file_t suspend_file = XB_FILE_UNDEFINED;
10- pid_t pid;
11- char buffer[64];
12+ File suspend_file;
13+ pid_t pid;
14+ char buffer[64];
15
16 pid = getpid();
17- sprintf(buffer, "%d", pid);
18-
19- msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n", path, pid);
20-
21- suspend_file = xb_file_create_no_error_handling(path, OS_FILE_CREATE,
22- OS_FILE_READ_WRITE,
23- &success);
24-
25- if (success && suspend_file != XB_FILE_UNDEFINED) {
26- xb_os_file_write(path, suspend_file, buffer, 0, strlen(buffer));
27- os_file_close(suspend_file);
28- return(TRUE);
29+ snprintf(buffer, sizeof(buffer), "%u", (uint) pid);
30+
31+ msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n",
32+ path, (uint) pid);
33+
34+ suspend_file = my_create(path, 0, O_WRONLY | O_EXCL | O_NOFOLLOW,
35+ MYF(MY_WME));
36+
37+ if (suspend_file >= 0) {
38+ ibool rc;
39+
40+ rc = my_write(suspend_file, (uchar *) buffer, strlen(buffer),
41+ MYF(MY_WME | MY_NABP)) == 0;
42+
43+ my_close(suspend_file, MYF(MY_WME));
44+ return(rc);
45 }
46
47- msg("xtrabackup: Error: failed to create file '%s' with %d\n", path,
48- os_file_get_last_error(TRUE));
49-
50+ msg("xtrabackup: Error: failed to create file '%s'\n",
51+ path);
52 return(FALSE);
53 }
54

Subscribers

People subscribed via source and target branches