Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-24 Thread Bob Beck
Now is not the time for this diff Please wait a week or so till the ports mysteries are sorted Patch updated. ok? Index: nfsd.c === RCS file: /cvs/src/sbin/nfsd/nfsd.c,v retrieving revision 1.32 diff -u -p -u -r1.32 nfsd.c --- nfsd.

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-24 Thread Peter Malone
Thanks Ted. I sent through another patch with timeout = -1. Passing INFTIM sounds like the best option though. Hopefully the rest checks out. On 04/24/14 20:30, Ted Unangst wrote: On Thu, Apr 24, 2014 at 19:27, Peter Malone wrote: The more I think about this. if we want to continue the

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-24 Thread Ted Unangst
On Thu, Apr 24, 2014 at 19:27, Peter Malone wrote: > The more I think about this. if we want to continue the select() > NULL functionality then timeout should be a negative value for poll(), > as NULL is unrecognized and zero is a zero-length timeout. The standard way to effect no timeout fo

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-24 Thread Peter Malone
Patch updated. ok? Index: nfsd.c === RCS file: /cvs/src/sbin/nfsd/nfsd.c,v retrieving revision 1.32 diff -u -p -u -r1.32 nfsd.c --- nfsd.c 11 Mar 2013 17:40:10 - 1.32 +++ nfsd.c 24 Apr 2014 23:35:06 - @@ -103,

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-24 Thread Peter Malone
The more I think about this. if we want to continue the select() NULL functionality then timeout should be a negative value for poll(), as NULL is unrecognized and zero is a zero-length timeout. On 04/24/14 18:08, Peter Malone wrote: As promised. I cleaned up some of the code as well. On

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-24 Thread Peter Malone
As promised. I cleaned up some of the code as well. One item of note - select() took a NULL value for timeout. I did not want to do this with poll(), so I defaulted with 10 instead. We should probably discuss this. I didn't even try to compile poll() with NULL - I don't think it's a good idea a

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-23 Thread Peter Malone
Sounds good. I'll work on that tomorrow afternoon/evening. On 04/23/14 21:55, Ted Unangst wrote: On Wed, Apr 23, 2014 at 21:38, Peter Malone wrote: Hi, Similar to the others. malloc & memset replacement with calloc, this time in sbin/nfsd/nfsd.c fd_size = howmany(maxsock + 1, NFDBITS)

Re: [patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-23 Thread Ted Unangst
On Wed, Apr 23, 2014 at 21:38, Peter Malone wrote: > Hi, > > Similar to the others. malloc & memset replacement with calloc, this time > in sbin/nfsd/nfsd.c > fd_size = howmany(maxsock + 1, NFDBITS) * sizeof(fd_mask); > - sockbits = malloc(fd_size); > + sockbits = calloc(1, fd_size)

[patch sbin/nfsd/nfsd.c] replace malloc & memset with calloc

2014-04-23 Thread Peter Malone
Hi, Similar to the others. malloc & memset replacement with calloc, this time in sbin/nfsd/nfsd.c Index: nfsd.c === RCS file: /cvs/src/sbin/nfsd/nfsd.c,v retrieving revision 1.32 diff -u -p -u -r1.32 nfsd.c --- nfsd.c 11 Mar 20