mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
linux(4): make getcwd(2) return ERANGE instead of ENOMEM
For native FreeBSD binaries, the return value from __getcwd(2)
doesn't really matter, as the libc wrapper takes over and returns
the proper errno.
PR: kern/254120
Reported By: Alex S <iwtcex@gmail.com>
Reviewed By: kib
Sponsored By: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29217
(cherry picked from commit 0dfbdd9fc2)
This commit is contained in:
parent
0264d12ee8
commit
ab1a91d958
1 changed files with 2 additions and 0 deletions
|
|
@ -74,6 +74,8 @@ linux_getcwd(struct thread *td, struct linux_getcwd_args *uap)
|
|||
|
||||
buf = malloc(buflen, M_TEMP, M_WAITOK);
|
||||
error = vn_getcwd(buf, &retbuf, &buflen);
|
||||
if (error == ENOMEM)
|
||||
error = ERANGE;
|
||||
if (error == 0) {
|
||||
error = copyout(retbuf, uap->buf, buflen);
|
||||
if (error == 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue