Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit943548c

Browse files
committed
use setvbuf instead of setbuffer
1 parent0cef487 commit943548c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎src/data.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,15 +623,15 @@ backup_data_file(ConnectionArgs* conn_arg, pgFile *file,
623623
}
624624

625625
if (!fio_is_remote_file(in))
626-
setbuffer(in,in_buffer,STDIO_BUFSIZE);
626+
setvbuf(in,in_buffer,_IOFBF,STDIO_BUFSIZE);
627627

628628
/* open backup file for write */
629629
out=fopen(to_fullpath,PG_BINARY_W);
630630
if (out==NULL)
631631
elog(ERROR,"Cannot open backup file \"%s\": %s",
632632
to_fullpath,strerror(errno));
633633

634-
setbuffer(out,out_buffer,STDIO_BUFSIZE);
634+
setvbuf(out,out_buffer,_IOFBF,STDIO_BUFSIZE);
635635

636636
/* update file permission */
637637
if (chmod(to_fullpath,FILE_PERMISSION)==-1)
@@ -874,7 +874,7 @@ restore_data_file(parray *parent_chain, pgFile *dest_file, FILE *out, const char
874874
elog(ERROR,"Cannot open backup file \"%s\": %s",from_fullpath,
875875
strerror(errno));
876876

877-
setbuffer(in,buffer,STDIO_BUFSIZE);
877+
setvbuf(in,buffer,_IOFBF,STDIO_BUFSIZE);
878878

879879
/*
880880
* Restore the file.
@@ -1164,7 +1164,7 @@ restore_non_data_file(parray *parent_chain, pgBackup *dest_backup,
11641164
elog(ERROR,"Cannot open backup file \"%s\": %s",from_fullpath,
11651165
strerror(errno));
11661166

1167-
setbuffer(in,buffer,STDIO_BUFSIZE);
1167+
setvbuf(in,buffer,_IOFBF,STDIO_BUFSIZE);
11681168

11691169
/* do actual work */
11701170
restore_non_data_file_internal(in,out,tmp_file,from_fullpath,to_fullpath);

‎src/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ merge_data_file(parray *parent_chain, pgBackup *full_backup,
11321132
if (out==NULL)
11331133
elog(ERROR,"Cannot open merge target file \"%s\": %s",
11341134
to_fullpath_tmp1,strerror(errno));
1135-
setbuffer(out,buffer,STDIO_BUFSIZE);
1135+
setvbuf(out,buffer,_IOFBF,STDIO_BUFSIZE);
11361136

11371137
/* restore file into temp file */
11381138
tmp_file->size=restore_data_file(parent_chain,dest_file,out,to_fullpath_tmp1);

‎src/restore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ restore_files(void *arg)
857857
gotodone;
858858

859859
if (!fio_is_remote_file(out))
860-
setbuffer(out,buffer,STDIO_BUFSIZE);
860+
setvbuf(out,buffer,_IOFBF,STDIO_BUFSIZE);
861861

862862
/* Restore destination file */
863863
if (dest_file->is_datafile&& !dest_file->is_cfs)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp