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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
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 * Update GPT attribute bits. 5 * Update GPT attribute bits.
6 */ 6 */
7 #include <getopt.h> 7 #include <getopt.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return CGPT_FAILED; 118 return CGPT_FAILED;
119 } 119 }
120 } 120 }
121 } 121 }
122 return CGPT_OK; 122 return CGPT_OK;
123 } 123 }
124 124
125 int OpenDriveInLastArgument(const int argc, 125 int OpenDriveInLastArgument(const int argc,
126 char *const *argv, 126 char *const *argv,
127 struct drive *drive) { 127 struct drive *drive) {
128 /* Then, we need a non-option argument. */ 128 if (optind != (argc - 1)) {
129 if (optind == (argc - 1)) {
130 char *path, drive_path[256];
131 path = argv[optind];
132 switch (path[0]) {
133 case '.':
134 case '/':
135 snprintf(drive_path, sizeof(drive_path), "%s", path);
136 break;
137 default:
138 snprintf(drive_path, sizeof(drive_path), "/dev/%s", path);
139 break;
140 }
141 if (CGPT_OK != DriveOpen(drive_path, drive)) {
142 printf("[ERROR] DriveOpen(%s) error!\n", drive_path);
143 return CGPT_FAILED;
144 }
145 } else {
146 printf("[ERROR] One (and only one) non-option argument is required.\n"); 129 printf("[ERROR] One (and only one) non-option argument is required.\n");
147 return CGPT_FAILED; 130 return CGPT_FAILED;
148 } 131 }
149 132
150 return CGPT_OK; 133 return DriveOpen(argv[optind], drive);
151 } 134 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698