#define environ (*_NSGetEnviron())
#endif
+#if !defined(MAGICKCORE_WINDOWS_SUPPORT)
extern char
**environ;
+#endif
\f
/*
Global declarations.
random_info->secret_key=secret_key;
random_info->protocol_major=RandomProtocolMajorVersion;
random_info->protocol_minor=RandomProtocolMinorVersion;
- random_info->semaphore=AllocateSemaphoreInfo();
+ random_info->semaphore=AcquireSemaphoreInfo();
random_info->timestamp=(ssize_t) time(0);
random_info->signature=MagickSignature;
/*
(void) ResetMagickMemory(random_info->seed,0,sizeof(*random_info->seed));
random_info->signature=(~MagickSignature);
UnlockSemaphoreInfo(random_info->semaphore);
- DestroySemaphoreInfo(&random_info->semaphore);
+ RelinquishSemaphoreInfo(&random_info->semaphore);
random_info=(RandomInfo *) RelinquishMagickMemory(random_info);
return(random_info);
}
#if defined(MAGICKCORE_HAVE_MKSTEMP)
{
char
- *filename;
+ path[MaxTextExtent];
int
file;
- filename=ConstantString("magickXXXXXX");
- file=mkstemp(filename);
+ (void) GetPathTemplate(path);
+ file=mkstemp(path);
#if defined(__OS2__)
setmode(file,O_BINARY);
#endif
if (file != -1)
(void) close(file);
- (void) remove_utf8(filename);
- SetStringInfoLength(chaos,strlen(filename));
- SetStringInfoDatum(chaos,(unsigned char *) filename);
+ (void) remove_utf8(path);
+ SetStringInfoLength(chaos,strlen(path));
+ SetStringInfoDatum(chaos,(unsigned char *) path);
ConcatenateStringInfo(entropy,chaos);
- filename=DestroyString(filename);
}
#endif
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
*/
MagickPrivate MagickBooleanType RandomComponentGenesis(void)
{
- AcquireSemaphoreInfo(&random_semaphore);
+ if (random_semaphore == (SemaphoreInfo *) NULL)
+ random_semaphore=AcquireSemaphoreInfo();
return(MagickTrue);
}
\f
MagickPrivate void RandomComponentTerminus(void)
{
if (random_semaphore == (SemaphoreInfo *) NULL)
- AcquireSemaphoreInfo(&random_semaphore);
- DestroySemaphoreInfo(&random_semaphore);
+ ActivateSemaphoreInfo(&random_semaphore);
+ RelinquishSemaphoreInfo(&random_semaphore);
}
\f
/*