compat_freebsd4: Fix handling of errors from subyte()

Upon failure, subyte() returns -1, not an errno value.

MFC after:	1 week
This commit is contained in:
Mark Johnston 2023-12-25 20:43:38 -05:00
parent 74e713804f
commit c38df501ce

View File

@ -364,13 +364,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;