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

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 658
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1210266-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 52 lines (+21/-18)
1 file modified
src/xtrabackup.cc (+21/-18)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1210266-2.1
Reviewer Review Type Date Requested Status
George Ormond Lorch III (community) g2 Approve
Review via email: mp+179851@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:47:20 +0000
3+++ src/xtrabackup.cc 2013-08-13 05:44:15 +0000
4@@ -2714,28 +2714,31 @@
5 /*================*/
6 const char* path) /*!<in: path to the sync file */
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- if (UNIV_LIKELY(success && suspend_file != XB_FILE_UNDEFINED)) {
25- xb_os_file_write(path, suspend_file, buffer, 0, strlen(buffer));
26- os_file_close(suspend_file);
27- return(TRUE);
28+ snprintf(buffer, sizeof(buffer), "%u", (uint) pid);
29+
30+ msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n",
31+ path, (uint) pid);
32+
33+ suspend_file = my_create(path, 0, O_WRONLY | O_EXCL | O_NOFOLLOW,
34+ MYF(MY_WME));
35+
36+ if (suspend_file >= 0) {
37+ ibool rc;
38+
39+ rc = my_write(suspend_file, (uchar *) buffer, strlen(buffer),
40+ MYF(MY_WME | MY_NABP)) == 0;
41+
42+ my_close(suspend_file, MYF(MY_WME));
43+ return(rc);
44 }
45
46- msg("xtrabackup: Error: failed to create file '%s' with %d\n", path,
47- os_file_get_last_error(TRUE));
48-
49+ msg("xtrabackup: Error: failed to create file '%s'\n",
50+ path);
51 return(FALSE);
52 }
53

Subscribers

People subscribed via source and target branches

to all changes: