Date: Sat, 13 Jun 2026 01:04:00 +0000 From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 669642faa394 - stable/15 - compat32 wait4/6(2): only copy out when there is a pid to report Message-ID: <6a2cac80.20f63.4d94c4a7@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=669642faa3942906438cd55b44921578fd3db2b4 commit 669642faa3942906438cd55b44921578fd3db2b4 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2026-06-09 21:33:56 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2026-06-13 00:58:39 +0000 compat32 wait4/6(2): only copy out when there is a pid to report PR: 295965 (cherry picked from commit 89fa97f0a71d4988891766c4e69eeb9687016b14) --- sys/compat/freebsd32/freebsd32_misc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index a0b6118900ed..e4a4f256feb4 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -234,11 +234,9 @@ freebsd32_wait4(struct thread *td, struct freebsd32_wait4_args *uap) else rup = NULL; error = kern_wait(td, uap->pid, &status, uap->options, rup); - if (error) - return (error); - if (uap->status != NULL) + if (uap->status != NULL && error == 0 && td->td_retval[0] != 0) error = copyout(&status, uap->status, sizeof(status)); - if (uap->rusage != NULL && error == 0) { + if (uap->rusage != NULL && error == 0 && td->td_retval[0] != 0) { freebsd32_rusage_out(&ru, &ru32); error = copyout(&ru32, uap->rusage, sizeof(ru32)); } @@ -265,11 +263,9 @@ freebsd32_wait6(struct thread *td, struct freebsd32_wait6_args *uap) sip = NULL; error = kern_wait6(td, uap->idtype, PAIR32TO64(id_t, uap->id), &status, uap->options, wrup, sip); - if (error != 0) - return (error); - if (uap->status != NULL) + if (uap->status != NULL && error == 0 && td->td_retval[0] != 0) error = copyout(&status, uap->status, sizeof(status)); - if (uap->wrusage != NULL && error == 0) { + if (uap->wrusage != NULL && error == 0 && td->td_retval[0] != 0) { freebsd32_rusage_out(&wru.wru_self, &wru32.wru_self); freebsd32_rusage_out(&wru.wru_children, &wru32.wru_children); error = copyout(&wru32, uap->wrusage, sizeof(wru32));home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a2cac80.20f63.4d94c4a7>
