From: kn Date: Sat, 8 Apr 2023 18:12:08 +0000 (+0000) Subject: Return -1 on actual failure X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=11e36004467c0870e04c93f9a96ff74915588421;p=openbsd Return -1 on actual failure MI boot.c's "a-x" fchmod on bsd.upgrade is the only caller that checks the return value and that call can fail on, e.g. softraid volumes. Stop clobbering the actual fchmod return value and get that warning printed. OK deraadt --- diff --git a/sys/lib/libsa/fchmod.c b/sys/lib/libsa/fchmod.c index f6252ca9e56..cb204d663fd 100644 --- a/sys/lib/libsa/fchmod.c +++ b/sys/lib/libsa/fchmod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fchmod.c,v 1.2 2021/12/01 17:25:35 kettenis Exp $ */ +/* $OpenBSD: fchmod.c,v 1.3 2023/04/08 18:12:08 kn Exp $ */ /* $NetBSD: stat.c,v 1.3 1994/10/26 05:45:07 cgd Exp $ */ /*- @@ -59,6 +59,7 @@ fchmod(int fd, mode_t m) return (-1); } - errno = (f->f_ops->fchmod)(f, m); + if ((errno = (f->f_ops->fchmod)(f, m))) + return (-1); return (0); }