case FileStream:
{
if (image->blob->synchronize != MagickFalse)
- {
- status=fflush(image->blob->file_info.file);
- status=fsync(fileno(image->blob->file_info.file));
- }
+ status=fsync(fileno(image->blob->file_info.file));
status=fclose(image->blob->file_info.file);
break;
}
break;
offset=SeekBlob(image,(MagickOffsetType) extent-1,SEEK_SET);
count=fwrite((const unsigned char *) "",1,1,image->blob->file_info.file);
+#if defined(MAGICKCORE_HAVE_POSIX_FALLOCATE)
+ if (image->blob->synchronize != MagickFalse)
+ {
+ int
+ status;
+
+ status=posix_fallocate(fileno(image->blob->file_info.file),offset,
+ extent-offset);
+ if (status != 0)
+ return(MagickFalse);
+ }
+#endif
offset=SeekBlob(image,offset,SEEK_SET);
if (count != (MagickOffsetType) 1)
return(MagickFalse);
offset=SeekBlob(image,(MagickOffsetType) extent-1,SEEK_SET);
count=fwrite((const unsigned char *) "",1,1,
image->blob->file_info.file);
+#if defined(MAGICKCORE_HAVE_POSIX_FALLOCATE)
+ if (image->blob->synchronize != MagickFalse)
+ {
+ int
+ status;
+
+ status=posix_fallocate(fileno(image->blob->file_info.file),offset,
+ extent-offset);
+ if (status != 0)
+ return(MagickFalse);
+ }
+#endif
offset=SeekBlob(image,offset,SEEK_SET);
if (count != (MagickOffsetType) 1)
return(MagickTrue);
*random_info;
MagickBooleanType
+ synchronize,
debug;
MagickThreadType
CacheInfo
*cache_info;
+ char
+ *synchronize;
+
cache_info=(CacheInfo *) AcquireQuantumMemory(1,sizeof(*cache_info));
if (cache_info == (CacheInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
cache_info->nexus_info=AcquirePixelCacheNexus(cache_info->number_threads);
if (cache_info->nexus_info == (NexusInfo **) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
+ synchronize=GetEnvironmentValue("MAGICK_SYNCHRONIZE");
+ if (synchronize != (const char *) NULL)
+ {
+ cache_info->synchronize=IsStringTrue(synchronize);
+ synchronize=DestroyString(synchronize);
+ }
cache_info->semaphore=AllocateSemaphoreInfo();
cache_info->reference_count=1;
cache_info->file_semaphore=AllocateSemaphoreInfo();
return(MagickTrue);
extent=(MagickOffsetType) length-1;
count=WritePixelCacheRegion(cache_info,extent,1,(const unsigned char *) "");
+#if defined(MAGICKCORE_HAVE_POSIX_FALLOCATE)
+ if (cache_info->synchronize != MagickFalse)
+ {
+ int
+ status;
+
+ status=posix_fallocate(cache_info->file,offset+1,extent-offset);
+ if (status != 0)
+ return(MagickFalse);
+ }
+#endif
return(count != (MagickOffsetType) 1 ? MagickFalse : MagickTrue);
}
*/
MagickExport void GetImageInfo(ImageInfo *image_info)
{
+ char
+ *synchronize;
+
ExceptionInfo
*exception;
image_info->quality=UndefinedCompressionQuality;
image_info->antialias=MagickTrue;
image_info->dither=MagickTrue;
- image_info->synchronize=IsStringTrue(GetEnvironmentValue(
- "MAGICK_SYNCHRONIZE"));
+ synchronize=GetEnvironmentValue("MAGICK_SYNCHRONIZE");
+ if (synchronize != (const char *) NULL)
+ {
+ image_info->synchronize=IsStringTrue(synchronize);
+ synchronize=DestroyString(synchronize);
+ }
exception=AcquireExceptionInfo();
(void) QueryColorCompliance(BackgroundColor,AllCompliance,
&image_info->background_color,exception);