mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libs/foreignmem: Fix/simplify errno handling for map_resource
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>
This commit is contained in:
1 parent
9351e1468d
commit
d203dbd69f
3 files changed
+5
-6
No files matched your search
@@ -133,9 +133,7 @@ int osdep_xenforeignmemory_map_resource(xenforeignmemory_handle *fmem,
|
||||
{
|
||||
int saved_errno;
|
||||
|
||||
if ( errno != ENOSYS )
|
||||
;
|
||||
else
|
||||
if ( errno == ENOSYS )
|
||||
errno = EOPNOTSUPP;
|
||||
|
||||
if ( fres->addr )
|
||||
|
||||
@@ -325,9 +325,7 @@ int osdep_xenforeignmemory_map_resource(
|
||||
{
|
||||
int saved_errno;
|
||||
|
||||
if ( errno != fmem->unimpl_errno && errno != EOPNOTSUPP )
|
||||
;
|
||||
else
|
||||
if ( errno == fmem->unimpl_errno )
|
||||
errno = EOPNOTSUPP;
|
||||
|
||||
if ( fres->addr )
|
||||
|
||||
@@ -147,6 +147,9 @@ int osdep_xenforeignmemory_map_resource(
|
||||
rc = ioctl(fmem->fd, IOCTL_PRIVCMD_MMAP_RESOURCE, &mr);
|
||||
if ( rc )
|
||||
{
|
||||
if ( errno == ENOSYS )
|
||||
errno = EOPNOTSUPP;
|
||||
|
||||
if ( fres->addr )
|
||||
{
|
||||
int saved_errno = errno;
|
||||
|
||||