am 294e610f: Merge "Fix verity on system partitions larger than 2G"

* commit '294e610f886eeb839d16172bb5b98559a6a7434d':
  Fix verity on system partitions larger than 2G
diff --git a/fs_mgr/fs_mgr_verity.c b/fs_mgr/fs_mgr_verity.c
index a452dce..55a6de8 100644
--- a/fs_mgr/fs_mgr_verity.c
+++ b/fs_mgr/fs_mgr_verity.c
@@ -155,7 +155,7 @@
     unsigned table_length;
     uint64_t device_length;
     int protocol_version;
-    FILE *device;
+    int device;
     int retval = FS_MGR_SETUP_VERITY_FAIL;
     *signature = 0;
     *table = 0;
@@ -238,11 +238,12 @@
         goto out;
     }
 
+    (*table)[table_length] = 0;
     retval = FS_MGR_SETUP_VERITY_SUCCESS;
 
 out:
-    if (device)
-        fclose(device);
+    if (device != -1)
+        TEMP_FAILURE_RETRY(close(device));
 
     if (retval != FS_MGR_SETUP_VERITY_SUCCESS) {
         free(*table);