From e2fca42f6ca0209f2a0ad3c721457f5f13b1b18b Mon Sep 17 00:00:00 2001 From: Zorg Date: Wed, 15 Apr 2015 00:09:32 -0400 Subject: [PATCH] Add error checking to a removeTree call --- Sparkle/SUBinaryDeltaApply.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUBinaryDeltaApply.m b/Sparkle/SUBinaryDeltaApply.m index ae45a45e..417b8325 100644 --- a/Sparkle/SUBinaryDeltaApply.m +++ b/Sparkle/SUBinaryDeltaApply.m @@ -131,7 +131,10 @@ int applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFil const char *value; if (!xar_prop_get(file, "delete", &value) || !xar_prop_get(file, "delete-then-extract", &value)) { - removeTree(destinationFilePath); + if (!removeTree(destinationFilePath)) { + fprintf(stderr, "delete or delete-then-extract: failed to remove %s\n", [destination fileSystemRepresentation]); + return 1; + } if (!xar_prop_get(file, "delete", &value)) continue; }