diff options
author | Idwer Vollering <vidwer@gmail.com> | 2021-05-10 21:15:45 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-20 10:31:43 +0000 |
commit | b384db34664466386016b03615fe1387aa2d53c7 (patch) | |
tree | 11192e23da45b41982aecb45ea74f274f6d697a0 /cgpt | |
parent | 6bdfa02d7dccfbc94871bf50f2282e2081b8559c (diff) | |
download | vboot-b384db34664466386016b03615fe1387aa2d53c7.tar.gz |
portability fixes: support building vboot on OpenBSDstabilize-13983.Bstabilize-13982.88.Bstabilize-13982.82.Bstabilize-13982.70.Bstabilize-13982.69.Bstabilize-13982.60.Bstabilize-13982.51.Brelease-R92-13982.B
This was done on OpenBSD 6.8.
Required packages are: e2fsprogs and gcc.
Change-Id: I86ec080e1ddb90053d81f1edd17d3406e7e737c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2903352
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'cgpt')
-rw-r--r-- | cgpt/cgpt.h | 2 | ||||
-rw-r--r-- | cgpt/cgpt_common.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/cgpt/cgpt.h b/cgpt/cgpt.h index 0747b5ce..89c357e8 100644 --- a/cgpt/cgpt.h +++ b/cgpt/cgpt.h @@ -7,7 +7,7 @@ #define VBOOT_REFERENCE_CGPT_H_ #include <fcntl.h> -#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) +#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) #include <features.h> #endif #include <stdint.h> diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c index 426be3b8..c3edd0fc 100644 --- a/cgpt/cgpt_common.c +++ b/cgpt/cgpt_common.c @@ -9,7 +9,7 @@ #include <errno.h> #include <fcntl.h> #include <getopt.h> -#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) +#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) #include <linux/major.h> #include <mtd/mtd-user.h> #endif @@ -295,7 +295,7 @@ static int ObtainDriveSize(int fd, uint64_t* size, uint32_t* sector_bytes) { if (fstat(fd, &stat) == -1) { return -1; } -#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) +#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) if ((stat.st_mode & S_IFMT) != S_IFREG) { if (ioctl(fd, BLKGETSIZE64, size) < 0) { return -1; @@ -325,7 +325,7 @@ int DriveOpen(const char *drive_path, struct drive *drive, int mode, memset(drive, 0, sizeof(struct drive)); drive->fd = open(drive_path, mode | -#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) +#if !defined(HAVE_MACOS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) O_LARGEFILE | #endif O_NOFOLLOW); |