diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-08 18:12:09 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-08 18:12:09 +0000 |
commit | faabe22890ccf6b338239acb5e7cc199b11c7e58 (patch) | |
tree | cb6ec3d9b64bf485bffe2be8229cff052dd6a371 /sys/lib/libsa | |
parent | b89546c755f76deea2c3a9e5b9b5b1132fc16eaa (diff) |
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
Diffstat (limited to 'sys/lib/libsa')
-rw-r--r-- | sys/lib/libsa/fchmod.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); } |