From 77d2c1df0e18ff48766b9d649d22c5638c4955aa Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 12 Sep 2018 23:14:38 -0400 Subject: [PATCH] libroot: Use RETURN_AND_SET_ERRNO from the utils header in ioctl. No functional change intended. Change-Id: I5e6a060fe8e036bc4d4b8b8cc95a4e8d0ea00f81 Reviewed-on: https://review.haiku-os.org/549 Reviewed-by: waddlesplash --- src/system/libroot/posix/unistd/ioctl.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/system/libroot/posix/unistd/ioctl.c b/src/system/libroot/posix/unistd/ioctl.c index a831a2964f..3f733df137 100644 --- a/src/system/libroot/posix/unistd/ioctl.c +++ b/src/system/libroot/posix/unistd/ioctl.c @@ -10,14 +10,7 @@ #include #include - - -#define RETURN_AND_SET_ERRNO(err) \ - if (err < 0) { \ - __set_errno(err); \ - return -1; \ - } \ - return err; +#include int @@ -35,5 +28,5 @@ ioctl(int fd, ulong cmd, ...) status = _kern_ioctl(fd, cmd, argument, size); - RETURN_AND_SET_ERRNO(status) + RETURN_AND_SET_ERRNO(status); }