diff options
author | hj kim <backto.kim@samsung.com> | 2018-12-13 16:00:00 +0900 |
---|---|---|
committer | hj kim <backto.kim@samsung.com> | 2018-12-13 16:02:34 +0900 |
commit | d7be1a5563a6bf59a8e9074287d4f7b6a64c8329 (patch) | |
tree | 8035829c49d7a51bc3c5d6a9fb7f8e74e0a3099c /magick/random.c | |
parent | dcc5a7178e7d3faf8f345642658392777c224191 (diff) | |
download | GraphicsMagick-d7be1a5563a6bf59a8e9074287d4f7b6a64c8329.tar.gz GraphicsMagick-d7be1a5563a6bf59a8e9074287d4f7b6a64c8329.tar.bz2 GraphicsMagick-d7be1a5563a6bf59a8e9074287d4f7b6a64c8329.zip |
Imported Upstream version 1.3.31upstream/1.3.31
Change-Id: I2c7294cf2abd64840c9513bbaed3c148dc673e1c
Diffstat (limited to 'magick/random.c')
-rw-r--r-- | magick/random.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/magick/random.c b/magick/random.c index be4af22..819e8f9 100644 --- a/magick/random.c +++ b/magick/random.c @@ -56,11 +56,11 @@ MagickExport MagickRandomKernel* AcquireMagickRandomKernel() if (kernel == (MagickRandomKernel *) NULL) { kernel=MagickAllocateAlignedMemory(MagickRandomKernel *, - MAGICK_CACHE_LINE_SIZE, - sizeof(MagickRandomKernel)); + MAGICK_CACHE_LINE_SIZE, + sizeof(MagickRandomKernel)); if (kernel == (MagickRandomKernel *) NULL) - MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, - UnableToAllocateRandomKernel); + MagickFatalError3(ResourceLimitFatalError,MemoryAllocationFailed, + UnableToAllocateRandomKernel); InitializeMagickRandomKernel(kernel); MagickTsdSetSpecific(kernel_key,(const void *) kernel); } @@ -91,7 +91,7 @@ void DestroyMagickRandomGenerator() if (initialized) { MagickRandomKernel - *kernel; + *kernel; /* FIXME: This only frees memory associated with one thread */ kernel=(MagickRandomKernel *) MagickTsdGetSpecific(kernel_key); @@ -128,9 +128,9 @@ InitializeMagickRandomKernel(MagickRandomKernel *kernel) if ((file=open("/dev/urandom",O_RDONLY | O_BINARY)) != -1) { - if (read(file,(void *) kernel,sizeof(*kernel)) == sizeof(*kernel)) + if (read(file,(void *) kernel,sizeof(*kernel)) == sizeof(*kernel)) done=MagickTrue; - (void) close(file); + (void) close(file); } if (!done) MagickFatalError(ResourceLimitFatalError,UnableToObtainRandomEntropy, @@ -188,7 +188,7 @@ InitializeMagickRandomKernel(MagickRandomKernel *kernel) pthread_t thread_id; magick_uint32_t intval; } pthread_union; - + pthread_union.intval=0U; pthread_union.thread_id=pthread_self(); kernel->w ^= pthread_union.intval; |