]> granicus.if.org Git - imagemagick/commitdiff
Added extra logging to ShredFile when a file cannot be removed.
authordirk <dirk@git.imagemagick.org>
Thu, 12 Feb 2015 22:33:15 +0000 (22:33 +0000)
committerdirk <dirk@git.imagemagick.org>
Thu, 12 Feb 2015 22:33:15 +0000 (22:33 +0000)
MagickCore/utility.c

index ef0f6584293708b76bb2d91b9f324bcf6f18eee0..24a9e0bf02bb2f763ec7d73d00322a9ab874bd9b 100644 (file)
@@ -1763,7 +1763,7 @@ MagickExport size_t MultilineCensus(const char *label)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   S h r e a d F i l e                                                       %
+%   S h r e d F i l e                                                         %
 %                                                                             %
 %                                                                             %
 %                                                                             %
@@ -1814,7 +1814,11 @@ MagickPrivate MagickBooleanType ShredFile(const char *path)
       */
       status=remove_utf8(path);
       if (status == -1)
-        return(MagickFalse);
+        {
+          (void) LogMagickEvent(ExceptionEvent,GetMagickModule(),
+            "Failed to remove: %s",path);
+          return(MagickFalse);
+        }
       return(MagickTrue);
     }
   file=open_utf8(path,O_WRONLY | O_EXCL | O_BINARY,S_MODE);
@@ -1824,6 +1828,9 @@ MagickPrivate MagickBooleanType ShredFile(const char *path)
         Don't shred the file, just remove it.
       */
       status=remove_utf8(path);
+      if (status == -1)
+        (void) LogMagickEvent(ExceptionEvent,GetMagickModule(),
+          "Failed to remove: %s",path);
       return(MagickFalse);
     }
   /*