]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-osilog-savestring-20080214
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 14 Feb 2008 14:09:18 +0000 (14:09 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 14 Feb 2008 14:09:18 +0000 (14:09 +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.

(cherry picked from commit 00bada9c5eb803c13a6b930e79684a470cf94278)

src/WINNT/client_osi/osilog.c

index c9604bfb8a1459192f3225b86cd00f1789acc7af..91c2f6ebe722122a2e3c238addf551223c3bfe7e 100644 (file)
@@ -273,6 +273,10 @@ char *osi_LogSaveString(osi_log_t *logp, char *s)
 {
        char *saveplace;
 
+        if (!logp) return s;
+
+        if (!logp->enabled) s;
+
        if (s == NULL) return NULL;
 
         thrd_EnterCrit(&logp->cs);