Okay, finally let's use the BSD'ish _howmany() macro.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1918 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
495beef2fc
commit
0fc06c6a3f
@ -69,14 +69,11 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
//#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#define howmany(x, y) _howmany(x, y)
|
||||
|
||||
#define DEFDATALEN (64 - 8) /* default data length */
|
||||
#define MAXIPLEN 60
|
||||
#define MAXICMPLEN 76
|
||||
@ -475,7 +472,7 @@ int main(int argc, char **argv)
|
||||
if ((options & F_FLOOD) == 0)
|
||||
catcher(); /* start things going */
|
||||
|
||||
fdmasks = howmany(s+1, NFDBITS) * sizeof(fd_mask);
|
||||
fdmasks = _howmany(s+1, NFDBITS) * sizeof(fd_mask);
|
||||
if ((fdmaskp = (fd_set *)malloc(fdmasks)) == NULL)
|
||||
err(1, "malloc");
|
||||
|
||||
|
@ -219,8 +219,6 @@
|
||||
#include <netinet/udp.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#define howmany(x, y) _howmany(x, y)
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <ctype.h>
|
||||
@ -696,7 +694,7 @@ wait_for_reply(sock, from, sent)
|
||||
size_t fromlen = sizeof (*from);
|
||||
fd_set *fdsp;
|
||||
|
||||
fdsn = howmany(sock+1, NFDBITS) * sizeof(fd_mask);
|
||||
fdsn = _howmany(sock+1, NFDBITS) * sizeof(fd_mask);
|
||||
if ((fdsp = (fd_set *)malloc(fdsn)) == NULL)
|
||||
err(1, "malloc");
|
||||
memset(fdsp, 0, fdsn);
|
||||
|
Loading…
Reference in New Issue
Block a user