aboutsummaryrefslogtreecommitdiffstats
path: root/src/fixup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fixup.c')
-rw-r--r--src/fixup.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/fixup.c b/src/fixup.c
new file mode 100644
index 0000000..af7b6d6
--- /dev/null
+++ b/src/fixup.c
@@ -0,0 +1,38 @@
+#include "project.h"
+
+
+
+int
+fixup (DISK * d)
+{
+ GPT_headers h;
+ int i;
+
+ h = headers_get_one (d);
+
+
+
+
+ for (i = 0; i < h.header.n_partition_entries; ++i)
+ {
+
+
+ GPT_entry e = entry_read (d, &h.header, i);
+
+
+ entry_write (d, &h.header, i, &e);
+
+ entry_write (d, &h.alt_header, i, &e);
+ }
+
+
+ header_redo_ent_crc (d, &h.header);
+ header_write (d, &h.header);
+
+ header_redo_ent_crc (d, &h.alt_header);
+ header_write (d, &h.alt_header);
+
+
+
+ return 0;
+}