mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-03-20 21:38:44 +02:00
Some changes for windows
This commit is contained in:
parent
bc016cfa61
commit
a2959609c8
@ -177,6 +177,9 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
|
|||||||
* There is no need to lock if this is elog() from upper elog().
|
* There is no need to lock if this is elog() from upper elog().
|
||||||
*/
|
*/
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
std_args = NULL;
|
||||||
|
error_args = NULL;
|
||||||
|
|
||||||
if (log_file_mutex == NULL)
|
if (log_file_mutex == NULL)
|
||||||
{
|
{
|
||||||
while (InterlockedExchange(&mutex_initlock, 1) == 1)
|
while (InterlockedExchange(&mutex_initlock, 1) == 1)
|
||||||
@ -190,14 +193,14 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
|
|||||||
loggin_in_progress = true;
|
loggin_in_progress = true;
|
||||||
|
|
||||||
/* We need copy args only if we need write to error log file */
|
/* We need copy args only if we need write to error log file */
|
||||||
//if (write_to_error_log)
|
if (write_to_error_log)
|
||||||
// va_copy(error_args, args);
|
va_copy(error_args, args);
|
||||||
/*
|
/*
|
||||||
* We need copy args only if we need write to stderr. But do not copy args
|
* We need copy args only if we need write to stderr. But do not copy args
|
||||||
* if we need to log only to stderr.
|
* if we need to log only to stderr.
|
||||||
*/
|
*/
|
||||||
// if (write_to_stderr && write_to_file)
|
if (write_to_stderr && write_to_file)
|
||||||
// va_copy(std_args, args);
|
va_copy(std_args, args);
|
||||||
|
|
||||||
if (write_to_file || write_to_error_log)
|
if (write_to_file || write_to_error_log)
|
||||||
strftime(strfbuf, sizeof(strfbuf), "%Y-%m-%d %H:%M:%S %Z",
|
strftime(strfbuf, sizeof(strfbuf), "%Y-%m-%d %H:%M:%S %Z",
|
||||||
@ -239,7 +242,6 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
|
|||||||
fprintf(error_log_file, "%s: ", strfbuf);
|
fprintf(error_log_file, "%s: ", strfbuf);
|
||||||
write_elevel(error_log_file, elevel);
|
write_elevel(error_log_file, elevel);
|
||||||
|
|
||||||
va_copy(error_args, args);
|
|
||||||
vfprintf(error_log_file, fmt, error_args);
|
vfprintf(error_log_file, fmt, error_args);
|
||||||
fputc('\n', error_log_file);
|
fputc('\n', error_log_file);
|
||||||
fflush(error_log_file);
|
fflush(error_log_file);
|
||||||
@ -254,7 +256,6 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
|
|||||||
if (write_to_stderr)
|
if (write_to_stderr)
|
||||||
{
|
{
|
||||||
write_elevel(stderr, elevel);
|
write_elevel(stderr, elevel);
|
||||||
va_copy(std_args, args);
|
|
||||||
if (write_to_file)
|
if (write_to_file)
|
||||||
vfprintf(stderr, fmt, std_args);
|
vfprintf(stderr, fmt, std_args);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user