Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: src/platform/vboot_reference/utility/cgpt/cgpt_options.c

Issue 2606002: Ignore the AlternateLBA field in the GPT headers. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/platform/vboot_reference/utility/cgpt/cgpt_options.c
diff --git a/src/platform/vboot_reference/utility/cgpt/cgpt_options.c b/src/platform/vboot_reference/utility/cgpt/cgpt_options.c
index c119ac9f49a8bebf16de39efb1172f6a0a869f4c..b434eeaf3650325f2553cf6221e1f0546d0646ab 100644
--- a/src/platform/vboot_reference/utility/cgpt/cgpt_options.c
+++ b/src/platform/vboot_reference/utility/cgpt/cgpt_options.c
@@ -125,27 +125,10 @@ int HandleOptions(const int argc,
int OpenDriveInLastArgument(const int argc,
char *const *argv,
struct drive *drive) {
- /* Then, we need a non-option argument. */
- if (optind == (argc - 1)) {
- char *path, drive_path[256];
- path = argv[optind];
- switch (path[0]) {
- case '.':
- case '/':
- snprintf(drive_path, sizeof(drive_path), "%s", path);
- break;
- default:
- snprintf(drive_path, sizeof(drive_path), "/dev/%s", path);
- break;
- }
- if (CGPT_OK != DriveOpen(drive_path, drive)) {
- printf("[ERROR] DriveOpen(%s) error!\n", drive_path);
- return CGPT_FAILED;
- }
- } else {
+ if (optind != (argc - 1)) {
printf("[ERROR] One (and only one) non-option argument is required.\n");
return CGPT_FAILED;
}
- return CGPT_OK;
+ return DriveOpen(argv[optind], drive);
}

Powered by Google App Engine
This is Rietveld 408576698