TimerInfo
timer;
- size_t
- signature;
-
MagickLogMethod
method;
+
+ SemaphoreInfo
+ *event_semaphore;
+
+ size_t
+ signature;
};
typedef struct _LogMapInfo
event_logging = MagickFalse;
static SemaphoreInfo
- *event_semaphore = (SemaphoreInfo *) NULL,
*log_semaphore = (SemaphoreInfo *) NULL;
\f
/*
exception=AcquireExceptionInfo();
(void) GetLogInfo("*",exception);
exception=DestroyExceptionInfo(exception);
- event_semaphore=AcquireSemaphoreInfo();
return(MagickTrue);
}
\f
p->path=DestroyString(p->path);
if (p->filename != (char *) NULL)
p->filename=DestroyString(p->filename);
+ if (p->event_semaphore == (SemaphoreInfo *) NULL)
+ ActivateSemaphoreInfo(&p->event_semaphore);
+ LockSemaphoreInfo(p->event_semaphore);
+ UnlockSemaphoreInfo(p->event_semaphore);
+ RelinquishSemaphoreInfo(&p->event_semaphore);
p=(LogInfo *) RelinquishMagickMemory(p);
return((void *) NULL);
}
MagickPrivate void LogComponentTerminus(void)
{
- if (event_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&event_semaphore);
- LockSemaphoreInfo(event_semaphore);
- UnlockSemaphoreInfo(event_semaphore);
- RelinquishSemaphoreInfo(&event_semaphore);
if (log_semaphore == (SemaphoreInfo *) NULL)
ActivateSemaphoreInfo(&log_semaphore);
LockSemaphoreInfo(log_semaphore);
exception=AcquireExceptionInfo();
log_info=(LogInfo *) GetLogInfo("*",exception);
exception=DestroyExceptionInfo(exception);
- if (event_semaphore == (SemaphoreInfo *) NULL)
- ActivateSemaphoreInfo(&event_semaphore);
- LockSemaphoreInfo(event_semaphore);
+ if (log_info->event_semaphore == (SemaphoreInfo *) NULL)
+ ActivateSemaphoreInfo(&log_info->event_semaphore);
+ LockSemaphoreInfo(log_info->event_semaphore);
if ((log_info->event_mask & type) == 0)
{
- UnlockSemaphoreInfo(event_semaphore);
+ UnlockSemaphoreInfo(log_info->event_semaphore);
return(MagickTrue);
}
domain=CommandOptionToMnemonic(MagickLogEventOptions,type);
if (text == (char *) NULL)
{
(void) ContinueTimer((TimerInfo *) &log_info->timer);
- UnlockSemaphoreInfo(event_semaphore);
+ UnlockSemaphoreInfo(log_info->event_semaphore);
return(MagickFalse);
}
if ((log_info->handler_mask & ConsoleHandler) != 0)
file_info.st_size=0;
if (log_info->file != (FILE *) NULL)
(void) fstat(fileno(log_info->file),&file_info);
- if (file_info.st_size > (ssize_t) (1024*1024*log_info->limit))
+ if (file_info.st_size > (MagickOffsetType) (1024*1024*log_info->limit))
{
(void) FormatLocaleFile(log_info->file,"</log>\n");
(void) fclose(log_info->file);
if (filename == (char *) NULL)
{
(void) ContinueTimer((TimerInfo *) &log_info->timer);
- UnlockSemaphoreInfo(event_semaphore);
+ UnlockSemaphoreInfo(log_info->event_semaphore);
return(MagickFalse);
}
log_info->append=IsPathAccessible(filename);
filename=(char *) RelinquishMagickMemory(filename);
if (log_info->file == (FILE *) NULL)
{
- UnlockSemaphoreInfo(event_semaphore);
+ UnlockSemaphoreInfo(log_info->event_semaphore);
return(MagickFalse);
}
log_info->generation++;
}
text=(char *) RelinquishMagickMemory(text);
(void) ContinueTimer((TimerInfo *) &log_info->timer);
- UnlockSemaphoreInfo(event_semaphore);
+ UnlockSemaphoreInfo(log_info->event_semaphore);
return(MagickTrue);
}