2714
2714
/*================*/
2715
2715
const char* path) /*!<in: path to the sync file */
2718
os_file_t suspend_file = XB_FILE_UNDEFINED;
2722
2721
pid = getpid();
2723
sprintf(buffer, "%d", pid);
2725
msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n", path, pid);
2727
suspend_file = xb_file_create_no_error_handling(path, OS_FILE_CREATE,
2730
if (UNIV_LIKELY(success && suspend_file != XB_FILE_UNDEFINED)) {
2731
xb_os_file_write(path, suspend_file, buffer, 0, strlen(buffer));
2732
os_file_close(suspend_file);
2722
snprintf(buffer, sizeof(buffer), "%u", (uint) pid);
2724
msg("xtrabackup: Creating suspend file '%s' with pid '%u'\n",
2727
suspend_file = my_create(path, 0, O_WRONLY | O_EXCL | O_NOFOLLOW,
2730
if (suspend_file >= 0) {
2733
rc = my_write(suspend_file, (uchar *) buffer, strlen(buffer),
2734
MYF(MY_WME | MY_NABP)) == 0;
2736
my_close(suspend_file, MYF(MY_WME));
2736
msg("xtrabackup: Error: failed to create file '%s' with %d\n", path,
2737
os_file_get_last_error(TRUE));
2740
msg("xtrabackup: Error: failed to create file '%s'\n",