about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-09-09 21:46:08 -0400
committerUlrich Drepper <drepper@gmail.com>2011-09-09 21:46:08 -0400
commitf19009c1551a396ee8eff96a83254243ce25a090 (patch)
tree0983371068093a21a21e4f8c0cfa4756a95103eb
parent3f8cc204fdd077da66ffc8e9595158b469e2b8e5 (diff)
downloadglibc-f19009c1551a396ee8eff96a83254243ce25a090.tar.gz
glibc-f19009c1551a396ee8eff96a83254243ce25a090.tar.xz
glibc-f19009c1551a396ee8eff96a83254243ce25a090.zip
Use (void*) instead of 0 for return value pointer in __cmsg_nexthdr
-rw-r--r--ChangeLog7
-rw-r--r--sysdeps/unix/bsd/bsd4.4/bits/socket.h4
-rw-r--r--sysdeps/unix/sysv/linux/bits/socket.h4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/socket.h4
4 files changed, 13 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7cc7ab0d38..6ea3e112d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-09-09  Ulrich Drepper  <drepper@gmail.com>
 
+	* sysdeps/unix/bsd/bsd4.4/bits/socket.h (__cmsg_nxthdr): Use NULL
+	instead of 0.
+	* sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Use (void*)0
+	instead of 0.                              .
+	* sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
+	Patch in part by Pavel Roskin <proski@gnu.org>.
+
 	[BZ #13138]
 	* stdio-common/vfscanf.c (ADDW): Allocate large memory block with
 	realloc.
diff --git a/sysdeps/unix/bsd/bsd4.4/bits/socket.h b/sysdeps/unix/bsd/bsd4.4/bits/socket.h
index 2ccd01d011..79251ab39c 100644
--- a/sysdeps/unix/bsd/bsd4.4/bits/socket.h
+++ b/sysdeps/unix/bsd/bsd4.4/bits/socket.h
@@ -236,7 +236,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
-    return 0;
+    return NULL;
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
@@ -245,7 +245,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
-    return 0;
+    return NULL;
   return __cmsg;
 }
 #endif	/* Use `extern inline'.  */
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 36757d64dc..911b431af3 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -318,7 +318,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
-    return 0;
+    return (void *) 0;
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
@@ -327,7 +327,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
-    return 0;
+    return (void *) 0;
   return __cmsg;
 }
 #endif	/* Use `extern inline'.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/socket.h b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
index 5f85d2170d..c7ef5d896a 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/socket.h
@@ -318,7 +318,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
     /* The kernel header does this so there may be a reason.  */
-    return 0;
+    return (void *) 0;
 
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
 			       + CMSG_ALIGN (__cmsg->cmsg_len));
@@ -327,7 +327,7 @@ __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
 	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
     /* No more entries.  */
-    return 0;
+    return (void *) 0;
   return __cmsg;
 }
 #endif	/* Use `extern inline'.  */