From 709fe4964704234d5e52a692d628fad98a8f4fbb Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 8 Aug 2024 13:59:12 +0000 Subject: Prevent spurious "/bsd.upgrade is not u+x" message when the file is missing. ok kn@ --- sys/arch/powerpc64/stand/rdboot/cmd.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sys/arch/powerpc64') 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(); -- cgit v1.2.3