1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

> Yikes, that is certainly not standard C. I have never seen that

before.
> Looks like a GNU-ism.  I nice one, but still a GNU-ism.

Sorry, I didn't know it is a GNU extension. I have written this patch
which should fix the problem. Let me know if you still have problems.

Massimo Dal Zotto
This commit is contained in:
Bruce Momjian
1998-09-03 02:20:30 +00:00
parent 9fbaf1d851
commit d318315200
2 changed files with 37 additions and 2 deletions

View File

@ -129,6 +129,34 @@ tprintf(int flag, const char *fmt,...)
return 1;
}
/*
* Print a timestamp and a message to stdout or to syslog.
*/
int
tprintf1(const char *fmt, ... )
{
va_list ap;
char line[ELOG_MAXLEN+TIMESTAMP_SIZE+1];
va_start(ap, fmt);
#ifdef ELOG_TIMESTAMPS
strcpy(line, tprintf_timestamp());
#endif
vsprintf(line+TIMESTAMP_SIZE, fmt, ap);
va_end(ap);
#ifdef USE_SYSLOG
write_syslog(LOG_INFO, line+TIMESTAMP_SIZE);
#endif
if (UseSyslog <= 1) {
puts(line);
fflush(stdout);
}
return 1;
}
/*
* Print a timestamp and a message to stderr.
*/