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

Commit85b2fac

Browse files
committed
Write config files as text not binary, per Magnus Hagander.
1 parent15db031 commit85b2fac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.64 2004/10/22 22:30:57 tgl Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.65 2004/10/24 15:55:29 tgl Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -407,14 +407,17 @@ readfile(char *path)
407407

408408
/*
409409
* write an array of lines to a file
410+
*
411+
* This is only used to write text files. Use fopen "w" not PG_BINARY_W
412+
* so that the resulting configuration files are nicely editable on Windows.
410413
*/
411414
staticvoid
412415
writefile(char*path,char**lines)
413416
{
414417
FILE*out_file;
415418
char**line;
416419

417-
if ((out_file=fopen(path,PG_BINARY_W))==NULL)
420+
if ((out_file=fopen(path,"w"))==NULL)
418421
{
419422
fprintf(stderr,_("%s: could not open file \"%s\" for writing: %s\n"),
420423
progname,path,strerror(errno));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp