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

Commitdf8b5f3

Browse files
committed
Revert "Allow concurrent-safe open() and fopen() in frontend code for Windows"
This reverts commitf02259f, in thev11 branch only.The hack this required in initdb.c should probably have clued us that itwasn't really ready, but we didn't get the hint. Subsequent developmentshave made clear that it affected text-vs-binary behavior in a lot ofplaces, and there's no reason to think that any of those behavioral changesare desirable. There's no time to fix this before 11beta4, so just revertfor the moment. We can keep working on this in HEAD, and maybe reconsidera back-patch once we're satisfied things are stable.(I take the blame for this fiasco, having encouraged Michael to back-patcha change at the last possible moment before beta wrap.)
1 parent5c07d64 commitdf8b5f3

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,15 +490,7 @@ readfile(const char *path)
490490
char*buffer;
491491
intc;
492492

493-
#ifdefWIN32
494-
/*
495-
* On Windows, we have to open the file in text mode so that carriage
496-
* returns are stripped.
497-
*/
498-
if ((infile=fopen(path,"rt"))==NULL)
499-
#else
500493
if ((infile=fopen(path,"r"))==NULL)
501-
#endif
502494
{
503495
fprintf(stderr,_("%s: could not open file \"%s\" for reading: %s\n"),
504496
progname,path,strerror(errno));

‎src/bin/pg_basebackup/pg_receivewal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ FindStreamingStart(uint32 *tli)
287287

288288
snprintf(fullpath,sizeof(fullpath),"%s/%s",basedir,dirent->d_name);
289289

290-
fd=open(fullpath,O_RDONLY |PG_BINARY,0);
290+
fd=open(fullpath,O_RDONLY |PG_BINARY);
291291
if (fd<0)
292292
{
293293
fprintf(stderr,_("%s: could not open compressed file \"%s\": %s\n"),

‎src/bin/pg_verify_checksums/pg_verify_checksums.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ scan_file(const char *fn, BlockNumber segmentno)
8080
intf;
8181
BlockNumberblockno;
8282

83-
f=open(fn,O_RDONLY |PG_BINARY,0);
83+
f=open(fn,O_RDONLY |PG_BINARY);
8484
if (f<0)
8585
{
8686
fprintf(stderr,_("%s: could not open file \"%s\": %s\n"),

‎src/common/file_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pre_sync_fname(const char *fname, bool isdir, const char *progname)
222222
{
223223
intfd;
224224

225-
fd=open(fname,O_RDONLY |PG_BINARY,0);
225+
fd=open(fname,O_RDONLY |PG_BINARY);
226226

227227
if (fd<0)
228228
{
@@ -283,7 +283,7 @@ fsync_fname(const char *fname, bool isdir, const char *progname)
283283
* unsupported operations, e.g. opening a directory under Windows), and
284284
* logging others.
285285
*/
286-
fd=open(fname,flags,0);
286+
fd=open(fname,flags);
287287
if (fd<0)
288288
{
289289
if (errno==EACCES|| (isdir&&errno==EISDIR))

‎src/include/port.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,11 @@ extern bool rmtree(const char *path, bool rmtopdir);
249249
#defineO_DIRECT0x80000000
250250
externintpgwin32_open(constchar*,int,...);
251251
externFILE*pgwin32_fopen(constchar*,constchar*);
252+
253+
#ifndefFRONTEND
252254
#defineopen(a,b,c) pgwin32_open(a,b,c)
253255
#definefopen(a,b) pgwin32_fopen(a,b)
256+
#endif
254257

255258
/*
256259
* Mingw-w64 headers #define popen and pclose to _popen and _pclose. We want

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp