windows-osilog-savestring-20080214
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 15 Feb 2008 03:18:42 +0000 (03:18 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 15 Feb 2008 03:18:42 +0000 (03:18 +0000)
LICENSE MIT

When osi_Log is disabled, osi_LogSaveString will no longer copy the
provided string into the circular log buffer.  This saves a huge amount
of time.

src/WINNT/client_osi/osilog.c

index 81a8ca5..8d4d566 100644 (file)
@@ -255,6 +255,10 @@ char *osi_LogSaveString(osi_log_t *logp, char *s)
 {
        char *saveplace;
 
+        if (!logp) return s;
+
+        if (!logp->enabled) return s;
+
        if (s == NULL) return NULL;
 
         thrd_EnterCrit(&logp->cs);