Simplify the FreeBSD and Linux logic, left in this state by the previous
change. No functional change.
Duplicate the FreeBSD logic for NetBSD, to maintain the uniform ABI for
callers that EOPNOTSUPP covers all Xen/Kernel support.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Ian Jackson <iwj@xenproject.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
{
int saved_errno;
- if ( errno != ENOSYS )
- ;
- else
+ if ( errno == ENOSYS )
errno = EOPNOTSUPP;
if ( fres->addr )
{
int saved_errno;
- if ( errno != fmem->unimpl_errno && errno != EOPNOTSUPP )
- ;
- else
+ if ( errno == fmem->unimpl_errno )
errno = EOPNOTSUPP;
if ( fres->addr )
rc = ioctl(fmem->fd, IOCTL_PRIVCMD_MMAP_RESOURCE, &mr);
if ( rc )
{
+ if ( errno == ENOSYS )
+ errno = EOPNOTSUPP;
+
if ( fres->addr )
{
int saved_errno = errno;