mirror of
https://github.com/opnsense/src.git
synced 2026-04-24 07:37:25 -04:00
compat_freebsd4: Fix handling of errors from subyte()
Upon failure, subyte() returns -1, not an errno value. MFC after: 1 week (cherry picked from commit c38df501ce2ed7da128448f815ec627c39fd3bad)
This commit is contained in:
parent
9b28f3f032
commit
fecd8e111a
1 changed files with 4 additions and 6 deletions
|
|
@ -367,13 +367,11 @@ freebsd4_uname(struct thread *td, struct freebsd4_uname_args *uap)
|
|||
for(s = version; *s && *s != '#'; s++);
|
||||
|
||||
for(us = uap->name->version; *s && *s != ':'; s++) {
|
||||
error = subyte( us++, *s);
|
||||
if (error)
|
||||
return (error);
|
||||
if (subyte(us++, *s) != 0)
|
||||
return (EFAULT);
|
||||
}
|
||||
error = subyte( us++, 0);
|
||||
if (error)
|
||||
return (error);
|
||||
if (subyte(us++, 0) != 0)
|
||||
return (EFAULT);
|
||||
|
||||
name[0] = CTL_HW;
|
||||
name[1] = HW_MACHINE;
|
||||
|
|
|
|||
Loading…
Reference in a new issue