diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-12-16 21:19:30 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-12-16 21:19:30 +0100 |
commit | 10f1958417a4944a60a08230eae6a639209d52f8 (patch) | |
tree | 7662166d1cf40507e65fba6dbb9ee73a7c652afc /sysdeps/mach/hurd/ioctl.c | |
parent | 963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff) | |
parent | a2e487ce1c59d19345d9ecacc58de79febd869e4 (diff) |
Merge branch 'master' of git://sourceware.org/git/glibc into upstreamupstream
Diffstat (limited to 'sysdeps/mach/hurd/ioctl.c')
-rw-r--r-- | sysdeps/mach/hurd/ioctl.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c index 15b26f5bba..f450f9896e 100644 --- a/sysdeps/mach/hurd/ioctl.c +++ b/sysdeps/mach/hurd/ioctl.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2018 Free Software Foundation, Inc. +/* Copyright (C) 1992-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <errno.h> #include <sys/ioctl.h> @@ -66,15 +66,15 @@ __ioctl (int fd, unsigned long int request, ...) kern_return_t RetCode; } header_typecheck; }; - char data[3 * sizeof (mach_msg_type_t) + - msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) + - msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) + - _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))]; + char data[3 * sizeof (mach_msg_type_t) + + msg_align (_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type))) + + msg_align (_IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type))) + + _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))]; #else /* Untyped Mach IPC format. */ mig_reply_error_t header; - char data[_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type)) + - _IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type)) + - _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))]; + char data[_IOT_COUNT0 (type) * typesize (_IOT_TYPE0 (type)) + + _IOT_COUNT1 (type) * typesize (_IOT_TYPE1 (type)) + + _IOT_COUNT2 (type) * typesize (_IOT_TYPE2 (type))]; mach_msg_trailer_t trailer; #endif } msg; @@ -177,6 +177,7 @@ __ioctl (int fd, unsigned long int request, ...) case MACH_SEND_INVALID_REPLY: case MACH_RCV_INVALID_NAME: __mig_dealloc_reply_port (m->msgh_local_port); + /* Fall through. */ default: return err; } @@ -191,17 +192,17 @@ __ioctl (int fd, unsigned long int request, ...) } if (m->msgh_id != msgid + 100) - return (m->msgh_id == MACH_NOTIFY_SEND_ONCE ? - MIG_SERVER_DIED : MIG_REPLY_MISMATCH); + return (m->msgh_id == MACH_NOTIFY_SEND_ONCE + ? MIG_SERVER_DIED : MIG_REPLY_MISMATCH); - if (m->msgh_size != reply_size && - m->msgh_size != sizeof msg.header) + if (m->msgh_size != reply_size + && m->msgh_size != sizeof msg.header) return MIG_TYPE_ERROR; #ifdef MACH_MSG_TYPE_BIT - if (msg.header_typecheck.RetCodeType != - ((union { mach_msg_type_t t; int i; }) - { t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i) + if (msg.header_typecheck.RetCodeType + != ((union { mach_msg_type_t t; int i; }) + { t: io2mach_type (1, _IOTS (msg.header.RetCode)) }).i) return MIG_TYPE_ERROR; #endif return msg.header.RetCode; @@ -306,11 +307,11 @@ __ioctl (int fd, unsigned long int request, ...) } case 0: - if (m->msgh_size != reply_size || - ((_IOC_INOUT (request) & IOC_OUT) && - (out (_IOT_COUNT0 (type), _IOT_TYPE0 (type), arg, &arg) || - out (_IOT_COUNT1 (type), _IOT_TYPE1 (type), arg, &arg) || - out (_IOT_COUNT2 (type), _IOT_TYPE2 (type), arg, &arg)))) + if (m->msgh_size != reply_size + || ((_IOC_INOUT (request) & IOC_OUT) + && (out (_IOT_COUNT0 (type), _IOT_TYPE0 (type), arg, &arg) + || out (_IOT_COUNT1 (type), _IOT_TYPE1 (type), arg, &arg) + || out (_IOT_COUNT2 (type), _IOT_TYPE2 (type), arg, &arg)))) return __hurd_fail (MIG_TYPE_ERROR); return 0; @@ -318,6 +319,7 @@ __ioctl (int fd, unsigned long int request, ...) case EOPNOTSUPP: /* The server didn't understand the RPC. */ err = ENOTTY; + /* Fall through. */ default: return __hurd_fail (err); } |