summaryrefslogtreecommitdiff
path: root/win32/wsyslog.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-04-24 00:12:00 +0000
committerZeev Suraski <zeev@php.net>1999-04-24 00:12:00 +0000
commit0818d96c97ceec4dbb8251c5220a2fdcdf39f355 (patch)
treec56f529e445e4bee928e7c28e0ccbb7f67572f16 /win32/wsyslog.c
parent05d24c60223439b94d4100538331fb6749022ca3 (diff)
downloadphp-git-0818d96c97ceec4dbb8251c5220a2fdcdf39f355.tar.gz
A lot of cleanups... Removed old thread-safe code and other redundant code and files
Diffstat (limited to 'win32/wsyslog.c')
-rw-r--r--win32/wsyslog.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/win32/wsyslog.c b/win32/wsyslog.c
index 701eeed913..616b6f8a07 100644
--- a/win32/wsyslog.c
+++ b/win32/wsyslog.c
@@ -63,9 +63,8 @@ static HANDLE loghdl = NULL; /* handle of event source */
void closelog(void)
{
- TLS_VARS;
- DeregisterEventSource(GLOBAL(loghdl));
- efree(GLOBAL(loghdr));
+ DeregisterEventSource(loghdl);
+ efree(loghdr);
}
/* Emulator for BSD syslog() routine
@@ -80,10 +79,9 @@ void syslog(int priority, const char *message,...)
LPTSTR strs[2];
char tmp[1024]; /* callers must be careful not to pop this */
unsigned short etype;
- TLS_VARS;
/* default event source */
- if (!GLOBAL(loghdl))
+ if (!loghdl)
openlog("c-client", LOG_PID, LOG_MAIL);
switch (priority) { /* translate UNIX type into NT type */
case LOG_ALERT:
@@ -97,10 +95,10 @@ void syslog(int priority, const char *message,...)
}
va_start(args, message); /* initialize vararg mechanism */
vsprintf(tmp, message, args); /* build message */
- strs[0] = GLOBAL(loghdr); /* write header */
+ strs[0] = loghdr; /* write header */
strs[1] = tmp; /* then the message */
/* report the event */
- ReportEvent(GLOBAL(loghdl), etype, (unsigned short) priority, 2000, NULL, 2, 0, strs, NULL);
+ ReportEvent(loghdl, etype, (unsigned short) priority, 2000, NULL, 2, 0, strs, NULL);
va_end(args);
}
@@ -114,12 +112,11 @@ void syslog(int priority, const char *message,...)
void openlog(const char *ident, int logopt, int facility)
{
char tmp[1024];
- TLS_VARS;
- if (GLOBAL(loghdl)) {
+ if (loghdl) {
closelog();
}
- GLOBAL(loghdl) = RegisterEventSource(NULL, ident);
+ loghdl = RegisterEventSource(NULL, ident);
sprintf(tmp, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
- GLOBAL(loghdr) = estrdup(tmp); /* save header for later */
+ loghdr = estrdup(tmp); /* save header for later */
}