We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentf763b77 commit6259678Copy full SHA for 6259678
contrib/pg_upgrade/exec.c
@@ -52,7 +52,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
52
53
old_umask=umask(S_IRWXG |S_IRWXO);
54
55
-written=strlcpy(cmd,SYSTEMQUOTE,strlen(SYSTEMQUOTE));
+written=strlcpy(cmd,SYSTEMQUOTE,sizeof(cmd));
56
va_start(ap,fmt);
57
written+=vsnprintf(cmd+written,MAXCMDLEN-written,fmt,ap);
58
va_end(ap);
@@ -95,10 +95,16 @@ exec_prog(const char *log_file, const char *opt_log_file,
95
log_file);
96
}
97
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
+ */
103
if ((log=fopen_priv(log_file,"a+"))==NULL)
104
pg_log(PG_FATAL,"cannot write to log file %s\n",log_file);
105
fprintf(log,"\n\n");
106
fclose(log);
107
+#endif
108
109
returnresult==0;
110