From: miod Date: Thu, 8 Aug 2024 13:59:11 +0000 (+0000) Subject: Prevent spurious "/bsd.upgrade is not u+x" message when the file is missing. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=57e232a594c92a7ed0574dab339eb829b8cb57fc;p=openbsd Prevent spurious "/bsd.upgrade is not u+x" message when the file is missing. ok kn@ --- 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();