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

Commit6259678

Browse files
committed
Fix bugs in exec.c that prevented pg_upgrade working in Windows.
Backpatch to 9.2 - code before that is quite different and shouldnot have these defects.
1 parentf763b77 commit6259678

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎contrib/pg_upgrade/exec.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
5252

5353
old_umask=umask(S_IRWXG |S_IRWXO);
5454

55-
written=strlcpy(cmd,SYSTEMQUOTE,strlen(SYSTEMQUOTE));
55+
written=strlcpy(cmd,SYSTEMQUOTE,sizeof(cmd));
5656
va_start(ap,fmt);
5757
written+=vsnprintf(cmd+written,MAXCMDLEN-written,fmt,ap);
5858
va_end(ap);
@@ -95,10 +95,16 @@ exec_prog(const char *log_file, const char *opt_log_file,
9595
log_file);
9696
}
9797

98+
#ifndefWIN32
99+
/*
100+
* Can't do this on Windows, postmaster will still hold the log file
101+
* open if the command was "pg_ctl start".
102+
*/
98103
if ((log=fopen_priv(log_file,"a+"))==NULL)
99104
pg_log(PG_FATAL,"cannot write to log file %s\n",log_file);
100105
fprintf(log,"\n\n");
101106
fclose(log);
107+
#endif
102108

103109
returnresult==0;
104110
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp