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

Commit95f0d6a

Browse files
committed
do not overwrite file permissions in 'pg_controldata -c'
1 parent5a1e948 commit95f0d6a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/bin/pg_controldata/pg_controldata.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,13 @@ WriteControlFile(ControlFileData ControlFile, const char *progname, const char *
349349
memset(buffer,0,PG_CONTROL_SIZE);
350350
memcpy(buffer,&ControlFile,sizeof(ControlFileData));
351351

352-
unlink(ControlFilePath);
353-
354352
fd=open(ControlFilePath,
355-
O_RDWR |O_CREAT |O_EXCL |PG_BINARY,
353+
O_RDWR |PG_BINARY,
356354
S_IRUSR |S_IWUSR);
355+
357356
if (fd<0)
358357
{
359-
fprintf(stderr,_("%s: could notcreate pg_control file: %s\n"),
358+
fprintf(stderr,_("%s: could notopen pg_control file: %s\n"),
360359
progname,strerror(errno));
361360
exit(1);
362361
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp