summaryrefslogtreecommitdiff
path: root/cgpt/cgpt.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-04-30 11:33:13 -0700
committerGerrit <chrome-bot@google.com>2012-05-02 22:34:32 -0700
commit23429d3d782f7506fb4747356974294cce08ac47 (patch)
tree2c98d253f97d92b3c48ea3d87d4375e64f8ea4cd /cgpt/cgpt.h
parent81f704edad78f03deed5ef899a55e9d0c28dd16c (diff)
downloadvboot-23429d3d782f7506fb4747356974294cce08ac47.tar.gz
Let cgpt open devices in read-only mode when possible.
BUG=chromium-os:12430 TEST=manual Running "make; make runtests" in src/platform/vboot_refererence will test this change. Tests for use on a Chromebook are described in the bug report, but will require a USB or SD card that has a physical write-protect switch. Change-Id: I16a67bad3b59bec0981f4064f51fb1a29da65a90 Reviewed-on: https://gerrit.chromium.org/gerrit/21474 Tested-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'cgpt/cgpt.h')
-rw-r--r--cgpt/cgpt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgpt/cgpt.h b/cgpt/cgpt.h
index 1c809161..6851ded7 100644
--- a/cgpt/cgpt.h
+++ b/cgpt/cgpt.h
@@ -10,6 +10,7 @@
#endif
#define _FILE_OFFSET_BITS 64
+#include <fcntl.h>
#include <features.h>
#include <stdint.h>
#include <stdio.h>
@@ -61,7 +62,8 @@ struct drive {
};
-int DriveOpen(const char *drive_path, struct drive *drive);
+/* mode should be O_RDONLY or O_RDWR */
+int DriveOpen(const char *drive_path, struct drive *drive, int mode);
int DriveClose(struct drive *drive, int update_as_needed);
int CheckValid(const struct drive *drive);