about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/ioctl.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2005-12-29 10:51:20 +0000
committerRoland McGrath <roland@gnu.org>2005-12-29 10:51:20 +0000
commit1d02865b2db8a39c8a67145826456a37e8831d5d (patch)
treeb1bf0bfa0ca796d5f1cb49183065c549b410bd89 /sysdeps/mach/hurd/ioctl.c
parent8ad684db49bf9dc109c409cac38f744e3fa260c7 (diff)
downloadglibc-1d02865b2db8a39c8a67145826456a37e8831d5d.tar.gz
glibc-1d02865b2db8a39c8a67145826456a37e8831d5d.tar.xz
glibc-1d02865b2db8a39c8a67145826456a37e8831d5d.zip
* sysdeps/mach/hurd/errno.c: New file.
	* sysdeps/mach/hurd/ioctl.c (__ioctl): Use a union to avoid a cast.
Diffstat (limited to 'sysdeps/mach/hurd/ioctl.c')
-rw-r--r--sysdeps/mach/hurd/ioctl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index 6a540241a4..bcc78bc84e 100644
--- a/sysdeps/mach/hurd/ioctl.c
+++ b/sysdeps/mach/hurd/ioctl.c
@@ -58,7 +58,16 @@ __ioctl (int fd, unsigned long int request, ...)
   struct
   {
 #ifdef MACH_MSG_TYPE_BIT
-    mig_reply_header_t header;
+    union
+    {
+      mig_reply_header_t header;
+      struct
+      {
+	mach_msg_header_t	Head;
+	int			RetCodeType;
+	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))) +
@@ -192,7 +201,7 @@ __ioctl (int fd, unsigned long int request, ...)
 	return MIG_TYPE_ERROR;
 
 #ifdef MACH_MSG_TYPE_BIT
-      if (*(int *) &msg.header.RetCodeType !=
+      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;