summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2024-08-08 13:59:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2024-08-08 13:59:12 +0000
commit709fe4964704234d5e52a692d628fad98a8f4fbb (patch)
tree321ea44ba1f0f281dd7a9fca6438a1062c343dc2
parentd41f694d687d4b9b9ab427da44d99c19d0ba5d4e (diff)
Prevent spurious "/bsd.upgrade is not u+x" message when the file is missing.
ok kn@
-rw-r--r--sys/arch/octeon/stand/rdboot/cmd.c11
-rw-r--r--sys/arch/powerpc64/stand/rdboot/cmd.c11
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/arch/octeon/stand/rdboot/cmd.c b/sys/arch/octeon/stand/rdboot/cmd.c
index 6bdbf0bd999..2b0a1c36309 100644
--- a/sys/arch/octeon/stand/rdboot/cmd.c
+++ b/sys/arch/octeon/stand/rdboot/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.4 2023/10/20 19:55:49 kn Exp $ */
+/* $OpenBSD: cmd.c,v 1.5 2024/08/08 13:59:11 miod Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -499,11 +499,12 @@ upgrade(void)
path = disk_open(qualify("/bsd.upgrade"));
if (path == NULL)
return 0;
- if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode))
+ if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode)) {
ret = 1;
- if ((sb.st_mode & S_IXUSR) == 0) {
- printf("/bsd.upgrade is not u+x\n");
- ret = 0;
+ if ((sb.st_mode & S_IXUSR) == 0) {
+ printf("/bsd.upgrade is not u+x\n");
+ ret = 0;
+ }
}
disk_close();
diff --git a/sys/arch/powerpc64/stand/rdboot/cmd.c b/sys/arch/powerpc64/stand/rdboot/cmd.c
index 21f326a2dde..1172a1446b2 100644
--- a/sys/arch/powerpc64/stand/rdboot/cmd.c
+++ b/sys/arch/powerpc64/stand/rdboot/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.2 2023/10/20 19:58:16 kn Exp $ */
+/* $OpenBSD: cmd.c,v 1.3 2024/08/08 13:59:11 miod Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -499,11 +499,12 @@ upgrade(void)
path = disk_open(qualify("/bsd.upgrade"));
if (path == NULL)
return 0;
- if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode))
+ if (stat(path, &sb) == 0 && S_ISREG(sb.st_mode)) {
ret = 1;
- if ((sb.st_mode & S_IXUSR) == 0) {
- printf("/bsd.upgrade is not u+x\n");
- ret = 0;
+ if ((sb.st_mode & S_IXUSR) == 0) {
+ printf("/bsd.upgrade is not u+x\n");
+ ret = 0;
+ }
}
disk_close();