summaryrefslogtreecommitdiff
path: root/cgpt/cgpt_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgpt/cgpt_common.c')
-rw-r--r--cgpt/cgpt_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c
index 193f2e1e..8def05ef 100644
--- a/cgpt/cgpt_common.c
+++ b/cgpt/cgpt_common.c
@@ -269,6 +269,11 @@ int DriveClose(struct drive *drive, int update_as_needed) {
}
}
+ // Sync early! Only sync file descriptor here, and leave the whole system sync
+ // outside cgpt because whole system sync would trigger tons of disk accesses
+ // and timeout tests.
+ fsync(drive->fd);
+
close(drive->fd);
if (drive->gpt.primary_header)