diff --git a/stand/kboot/kboot/hostfs.c b/stand/kboot/kboot/hostfs.c --- a/stand/kboot/kboot/hostfs.c +++ b/stand/kboot/kboot/hostfs.c @@ -124,7 +124,7 @@ { hostfs_file *hf = f->f_fsdata; uint32_t offl, offh; - int err; + long err; uint64_t res; /* @@ -137,8 +137,15 @@ offl = res & 0xfffffffful; offh = (res >> 32) & 0xfffffffful; err = host_llseek(hf->hf_fd, offh, offl, &res, whence); - if (err < 0) - return (err); + /* + * Since we're interfacing to the raw linux system call, we have to + * carefully check. We have to translate the errno value from the host + * to libsa's conventions. + */ + if (is_linux_error(err)) { + errno = host_to_stand_errno(err); + return (-1); + } return (res); }