--- jk_util.c.orig Sun Apr 22 09:42:41 2001 +++ jk_util.c Sun Apr 22 09:42:36 2001 @@ -59,7 +59,7 @@ * Version: $Revision: 1.4 $ * ***************************************************************************/ - +#include #include "jk_util.h" #include "jk_ajp12_worker.h" @@ -204,6 +204,8 @@ char *f = (char *)(file + strlen(file) - 1); va_list args; int used = 0; + char timestr[24]; + time_t timet; while(f != file && '\\' != *f && '/' != *f) { f--; @@ -211,17 +213,24 @@ if(f != file) { f++; } - + + timet = time(0); + strftime(timestr, sizeof(timestr), "%H:%M:%S", localtime(&timet)); + + // Header format is time, process id (0 if unknown), file, line + #ifdef WIN32 - used = _snprintf(buf, HUGE_BUFFER_SIZE, "[%s (%d)]: ", f, line); + used = _snprintf(buf, HUGE_BUFFER_SIZE, "[%s 0 %s (%d)]: ", + timestr, f, line); #elif defined(NETWARE) // until we get a snprintf function buf = (char *) malloc(HUGE_BUFFER_SIZE); if (NULL == buf) return -1; - used = sprintf(buf, "[%s (%d)]: ", f, line); + used = sprintf(buf, "[%s 0 %s (%d)]: ", timestr, f, line); #else - used = snprintf(buf, HUGE_BUFFER_SIZE, "[%s (%d)]: ", f, line); + used = snprintf(buf, HUGE_BUFFER_SIZE, "[%s %d %s (%d)]: ", + timestr, (int) getpid(), f, line); #endif if(used < 0) { return 0; /* [V] not sure what to return... */