]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 16 Oct 2010 17:00:58 +0000 (17:00 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 16 Oct 2010 17:00:58 +0000 (17:00 +0000)
magick/blob.c

index d7df8e497a84a18037f89761f30e90ab65b79861..0c3c1d7b77ee7e660af2127acfcb201ff0af94fc 100644 (file)
@@ -530,7 +530,10 @@ MagickExport MagickBooleanType CloseBlob(Image *image)
     case StandardStream:
     {
       if (image->blob->synchronize != MagickFalse)
-        status=fsync(fileno(image->blob->file));
+        {
+          status=fflush(image->blob->file);
+          status=fsync(fileno(image->blob->file));
+        }
       status=fclose(image->blob->file);
       break;
     }
@@ -556,8 +559,17 @@ MagickExport MagickBooleanType CloseBlob(Image *image)
       break;
     }
     case FifoStream:
+      break;
     case BlobStream:
+    {
+      if (image->blob->file != (FILE *) NULL)
+        {
+          if (image->blob->synchronize != MagickFalse)
+            (void) fsync(fileno(image->blob->file));
+          status=fclose(image->blob->file);
+        }
       break;
+    }
   }
   (void) DetachBlob(image->blob);
   image->blob->status=status < 0 ? MagickTrue : MagickFalse;