about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/ioctl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/mach/hurd/ioctl.c
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
downloadglibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.xz
glibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.zip
2.5-18.1
Diffstat (limited to 'sysdeps/mach/hurd/ioctl.c')
-rw-r--r--sysdeps/mach/hurd/ioctl.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index 3d590d5845..bcc78bc84e 100644
--- a/sysdeps/mach/hurd/ioctl.c
+++ b/sysdeps/mach/hurd/ioctl.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992,93,94,95,96,97,99,2000,02 Free Software Foundation, Inc.
+/* Copyright (C) 1992,93,94,95,96,97,99,2000,2002,2005
+	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
@@ -57,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))) +
@@ -136,9 +146,11 @@ __ioctl (int fd, unsigned long int request, ...)
 	     Rather than pointing to the value, ARG is the value itself.  */
 #ifdef MACH_MSG_TYPE_BIT
 	  *t++ = io2mach_type (1, _IOTS (integer_t));
-	  *((integer_t *) t)++ = (integer_t) arg;
+	  *(integer_t *) t = (integer_t) arg;
+	  t = (void *) t + sizeof (integer_t);
 #else
-	  *((integer_t *) p)++ = (integer_t) arg;
+	  *(integer_t *) p = (integer_t) arg;
+	  p = (void *) p + sizeof (integer_t);
 #endif
 	}
 
@@ -189,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;