From c25b1d5c0452943600173bb45356cae68e6e7620 Mon Sep 17 00:00:00 2001 From: patrick Date: Tue, 26 Oct 2021 10:45:55 +0000 Subject: [PATCH] Remove more occurences of O_RDONLY in our bootloaders. "just do it" deraadt@ --- sys/arch/arm64/stand/efiboot/efiboot.c | 4 +--- sys/arch/armv7/stand/efiboot/efiboot.c | 4 +--- sys/arch/riscv64/stand/efiboot/efiboot.c | 4 +--- sys/arch/sparc64/stand/ofwboot/boot.c | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sys/arch/arm64/stand/efiboot/efiboot.c b/sys/arch/arm64/stand/efiboot/efiboot.c index 5cb52d9e8f0..a0de9574cfd 100644 --- a/sys/arch/arm64/stand/efiboot/efiboot.c +++ b/sys/arch/arm64/stand/efiboot/efiboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.c,v 1.34 2021/07/09 20:19:46 patrick Exp $ */ +/* $OpenBSD: efiboot.c,v 1.35 2021/10/26 10:45:55 patrick Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko @@ -1016,8 +1016,6 @@ Xdtb_efi(void) struct stat sb; int fd; -#define O_RDONLY 0 - if (cmd.argc != 2) { printf("dtb file\n"); return (0); diff --git a/sys/arch/armv7/stand/efiboot/efiboot.c b/sys/arch/armv7/stand/efiboot/efiboot.c index 588e1c99b10..9886d5bb01f 100644 --- a/sys/arch/armv7/stand/efiboot/efiboot.c +++ b/sys/arch/armv7/stand/efiboot/efiboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.c,v 1.35 2021/10/06 12:50:10 visa Exp $ */ +/* $OpenBSD: efiboot.c,v 1.36 2021/10/26 10:45:55 patrick Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko @@ -929,8 +929,6 @@ Xdtb_efi(void) struct stat sb; int fd; -#define O_RDONLY 0 - if (cmd.argc != 2) return (1); diff --git a/sys/arch/riscv64/stand/efiboot/efiboot.c b/sys/arch/riscv64/stand/efiboot/efiboot.c index 564cece9a4a..8760011b25e 100644 --- a/sys/arch/riscv64/stand/efiboot/efiboot.c +++ b/sys/arch/riscv64/stand/efiboot/efiboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.c,v 1.2 2021/06/25 17:49:49 krw Exp $ */ +/* $OpenBSD: efiboot.c,v 1.3 2021/10/26 10:45:55 patrick Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko @@ -963,8 +963,6 @@ Xdtb_efi(void) struct stat sb; int fd; -#define O_RDONLY 0 - if (cmd.argc != 2) { printf("dtb file\n"); return (0); diff --git a/sys/arch/sparc64/stand/ofwboot/boot.c b/sys/arch/sparc64/stand/ofwboot/boot.c index 9263c523890..bcb5062578c 100644 --- a/sys/arch/sparc64/stand/ofwboot/boot.c +++ b/sys/arch/sparc64/stand/ofwboot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.37 2021/10/24 17:49:19 deraadt Exp $ */ +/* $OpenBSD: boot.c,v 1.38 2021/10/26 10:45:55 patrick Exp $ */ /* $NetBSD: boot.c,v 1.3 2001/05/31 08:55:19 mrg Exp $ */ /* * Copyright (c) 1997, 1999 Eduardo E. Horvath. All rights reserved. @@ -287,8 +287,6 @@ loadrandom(char *path, char *buf, size_t buflen) struct stat sb; int fd, i, error = 0; -#define O_RDONLY 0 - fd = open(path, O_RDONLY); if (fd == -1) return -1; -- 2.20.1