]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 27 Dec 2012 00:35:49 +0000 (00:35 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 27 Dec 2012 00:35:49 +0000 (00:35 +0000)
MagickCore/blob.c

index a6f73fd50df2a5a953b9f9da286cbad7b1f95674..be313f67e209535bc6603f306d7fbad71a786102 100644 (file)
@@ -522,6 +522,8 @@ MagickExport MagickBooleanType CloseBlob(Image *image)
     case FileStream:
     case PipeStream:
     {
+      if (image->blob->synchronize != MagickFalse)
+        status=fsync(fileno(image->blob->file_info.file));
       status=ferror(image->blob->file_info.file);
       break;
     }
@@ -540,8 +542,14 @@ MagickExport MagickBooleanType CloseBlob(Image *image)
       break;
     }
     case FifoStream:
+      break;
     case BlobStream:
+    {
+      if ((image->blob->file_info.file != (FILE *) NULL) &&
+          (image->blob->synchronize != MagickFalse))
+        (void) fsync(fileno(image->blob->file_info.file));
       break;
+    }
   }
   image->blob->status=status < 0 ? MagickTrue : MagickFalse;
   image->blob->size=GetBlobSize(image);
@@ -559,8 +567,6 @@ MagickExport MagickBooleanType CloseBlob(Image *image)
       break;
     case FileStream:
     {
-      if (image->blob->synchronize != MagickFalse)
-        status=fsync(fileno(image->blob->file_info.file));
       status=fclose(image->blob->file_info.file);
       break;
     }
@@ -590,11 +596,7 @@ MagickExport MagickBooleanType CloseBlob(Image *image)
     case BlobStream:
     {
       if (image->blob->file_info.file != (FILE *) NULL)
-        {
-          if (image->blob->synchronize != MagickFalse)
-            (void) fsync(fileno(image->blob->file_info.file));
-          status=fclose(image->blob->file_info.file);
-        }
+        status=fclose(image->blob->file_info.file);
       break;
     }
   }