about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-11-15 08:22:03 +0000
committerJakub Jelinek <jakub@redhat.com>2005-11-15 08:22:03 +0000
commit22d7fbdbae4032639461a7a081762a05deee0529 (patch)
treeff70bd4613f1f05823b2417b2687449d73ac45b0 /sysdeps/mach
parent1beea155aecf2e7d6bfa1399b7c0f4f53dde408c (diff)
downloadglibc-22d7fbdbae4032639461a7a081762a05deee0529.tar.gz
glibc-22d7fbdbae4032639461a7a081762a05deee0529.tar.xz
glibc-22d7fbdbae4032639461a7a081762a05deee0529.zip
Updated to fedora-glibc-20051115T0809
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/bits/stat.h7
-rw-r--r--sysdeps/mach/hurd/getpeername.c13
-rw-r--r--sysdeps/mach/hurd/ioctl.c9
3 files changed, 19 insertions, 10 deletions
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 172bc5ea8e..c3f96660cc 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 93, 94, 96, 97, 99, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1992,93,94,96,97,99,2000,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
@@ -182,8 +182,11 @@ struct stat64
 /* All the bits relevant to translators */
 #define S_ITRANS	000070000000
 
+/* Definitely no mmaps to this.  */
+#define S_IMMAP0	000100000000
+
 /* ALL the unused bits.  */
-#define	S_ISPARE	(~(S_IFMT|S_ITRANS|S_INOCACHE|    \
+#define	S_ISPARE	(~(S_IFMT|S_ITRANS|S_INOCACHE|S_IMMAP0|    \
 			   S_IUSEUNK|S_IUNKNOWN|07777))
 #endif
 
diff --git a/sysdeps/mach/hurd/getpeername.c b/sysdeps/mach/hurd/getpeername.c
index 39071c1da4..325b6fd75d 100644
--- a/sysdeps/mach/hurd/getpeername.c
+++ b/sysdeps/mach/hurd/getpeername.c
@@ -55,11 +55,14 @@ __getpeername (int fd, __SOCKADDR_ARG addrarg, socklen_t *len)
     }
 
   const sa_family_t family = type;
-  if (*len < (char *) (&addr->sa_family + 1) - (char *) addr)
-    memcpy (&addr->sa_family, &family,
-	    *len - offsetof (struct sockaddr, sa_family));
-  else
-    addr->sa_family = family;
+  if (*len > offsetof (struct sockaddr, sa_family))
+    {
+      if (*len < (char *) (&addr->sa_family + 1) - (char *) addr)
+	memcpy (&addr->sa_family, &family,
+		*len - offsetof (struct sockaddr, sa_family));
+      else
+	addr->sa_family = family;
+    }
 
   return 0;
 }
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index 3d590d5845..6a540241a4 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
@@ -136,9 +137,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
 	}