| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 * | 4 * |
| 5 * Repair headers and tables. | 5 * Repair headers and tables. |
| 6 * | 6 * |
| 7 * If primary header or table is invalid, it copies from secondary (vice versa). | 7 * If primary header or table is invalid, it copies from secondary (vice versa). |
| 8 */ | 8 */ |
| 9 #include <getopt.h> | 9 #include <getopt.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 repair_options_details)) | 59 repair_options_details)) |
| 60 return CGPT_FAILED; | 60 return CGPT_FAILED; |
| 61 if (help != NOT_INITED) { | 61 if (help != NOT_INITED) { |
| 62 RepairHelp(); | 62 RepairHelp(); |
| 63 return CGPT_FAILED; | 63 return CGPT_FAILED; |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (CGPT_OK != OpenDriveInLastArgument(argc, argv, &drive)) | 66 if (CGPT_OK != OpenDriveInLastArgument(argc, argv, &drive)) |
| 67 return CGPT_FAILED; | 67 return CGPT_FAILED; |
| 68 | 68 |
| 69 GptRepair(&drive.gpt); |
| 70 if (drive.gpt.modified & GPT_MODIFIED_HEADER1) |
| 71 printf("* Pri Header is updated.\n"); |
| 72 if (drive.gpt.modified & GPT_MODIFIED_ENTRIES1) |
| 73 printf("* Pri Table Entries is updated.\n"); |
| 74 if (drive.gpt.modified & GPT_MODIFIED_ENTRIES2) |
| 75 printf("* Sec Table Entries is updated.\n"); |
| 76 if (drive.gpt.modified & GPT_MODIFIED_HEADER2) |
| 77 printf("* Sec Header is updated.\n"); |
| 78 |
| 69 DriveClose(&drive); | 79 DriveClose(&drive); |
| 70 | 80 |
| 71 return CGPT_OK; | 81 return CGPT_OK; |
| 72 } | 82 } |
| OLD | NEW |