Merge "Really don't use TEMP_FAILURE_RETRY with close in recovery."
diff --git a/applypatch/applypatch.c b/applypatch/applypatch.c
index 6f02a38..2358d42 100644
--- a/applypatch/applypatch.c
+++ b/applypatch/applypatch.c
@@ -662,7 +662,7 @@
         printf("failed to statfs %s: %s\n", filename, strerror(errno));
         return -1;
     }
-    return sf.f_bsize * sf.f_bfree;
+    return sf.f_bsize * sf.f_bavail;
 }
 
 int CacheSizeCheck(size_t bytes) {
diff --git a/updater/blockimg.c b/updater/blockimg.c
index 54f76ff..5d0f156 100644
--- a/updater/blockimg.c
+++ b/updater/blockimg.c
@@ -1485,7 +1485,6 @@
 
     if (!S_ISBLK(st.st_mode)) {
         fprintf(stderr, "not a block device; skipping erase\n");
-        rc = 0;
         goto pceout;
     }
 
@@ -1509,7 +1508,7 @@
 
             if (ioctl(params->fd, BLKDISCARD, &blocks) == -1) {
                 fprintf(stderr, "BLKDISCARD ioctl failed: %s\n", strerror(errno));
-                // Continue anyway, nothing we can do
+                goto pceout;
             }
         }
     }