select(2) nit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

select(2) nit

Joachim Schipper-2
The sample code given in the BUGS section of select(2) contains an
unnecessary cast.

                Joachim

Index: select.2
===================================================================
RCS file: /usr/cvs/src/src/lib/libc/sys/select.2,v
retrieving revision 1.28
diff -u -p -r1.28 select.2
--- select.2 31 May 2007 19:19:33 -0000 1.28
+++ select.2 12 Feb 2012 18:59:13 -0000
@@ -204,8 +204,7 @@ userland libraries:
 fd_set *fdsr;
 int max = fd;
 
-fdsr = (fd_set *)calloc(howmany(max+1, NFDBITS),
-    sizeof(fd_mask));
+fdsr = calloc(howmany(max+1, NFDBITS), sizeof(fd_mask));
 if (fdsr == NULL) {
  ...
  return (-1);