mirror of
https://git.freebsd.org/ports.git
synced 2025-06-04 12:26:27 -04:00
net/netselect: Jettison endian hacks
- Pet portclippy
This commit is contained in:
parent
4392d9218e
commit
7b6d75861b
2 changed files with 5 additions and 28 deletions
|
@ -11,11 +11,11 @@ LICENSE= BSD3CLAUSE
|
||||||
|
|
||||||
USES= gmake
|
USES= gmake
|
||||||
USE_GITHUB= yes
|
USE_GITHUB= yes
|
||||||
|
|
||||||
GH_ACCOUNT= apenwarr
|
GH_ACCOUNT= apenwarr
|
||||||
|
|
||||||
OPTIONS_DEFINE= SUID DOCS
|
OPTIONS_DEFINE= SUID DOCS
|
||||||
OPTIONS_SUB= yes
|
OPTIONS_SUB= yes
|
||||||
|
|
||||||
SUID_DESC= Install with the setuid bit to allow use by non-root users
|
SUID_DESC= Install with the setuid bit to allow use by non-root users
|
||||||
|
|
||||||
do-build:
|
do-build:
|
||||||
|
|
|
@ -1,29 +1,6 @@
|
||||||
--- netselect.c.orig 2010-10-26 23:08:55 UTC
|
--- netselect.c.orig 2010-10-26 23:08:55 UTC
|
||||||
+++ netselect.c
|
+++ netselect.c
|
||||||
@@ -39,15 +39,14 @@
|
@@ -167,6 +167,7 @@ int main(int argc, char **argv)
|
||||||
* hey, great! Let me know. -- apenwarr
|
|
||||||
*/
|
|
||||||
|
|
||||||
-#ifdef __EMX__
|
|
||||||
-# include <io.h>
|
|
||||||
-# include <fcntl.h>
|
|
||||||
-# include <sys/types.h>
|
|
||||||
-# include <sys/select.h>
|
|
||||||
-# include <machine/endian.h>
|
|
||||||
-#else
|
|
||||||
-# include <endian.h>
|
|
||||||
+#ifdef __linux__
|
|
||||||
+#include <endian.h>
|
|
||||||
+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
|
||||||
+#if defined(__OpenBSD__)
|
|
||||||
+#include <machine/types.h>
|
|
||||||
#endif
|
|
||||||
+#include <machine/endian.h>
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
@@ -167,6 +166,7 @@ int main(int argc, char **argv)
|
|
||||||
extern int optind;
|
extern int optind;
|
||||||
int hostcount, startcount, endcount = 0, sent_one, lag, min_lag = 100;
|
int hostcount, startcount, endcount = 0, sent_one, lag, min_lag = 100;
|
||||||
int ch, seq, ttl, max_ttl = 30, num_score = 1;
|
int ch, seq, ttl, max_ttl = 30, num_score = 1;
|
||||||
|
@ -31,7 +8,7 @@
|
||||||
int use_icmp = 0;
|
int use_icmp = 0;
|
||||||
unsigned int min_tries = 10;
|
unsigned int min_tries = 10;
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
@@ -280,7 +280,12 @@ int main(int argc, char **argv)
|
@@ -280,7 +281,12 @@ int main(int argc, char **argv)
|
||||||
if (verbose >= 1)
|
if (verbose >= 1)
|
||||||
fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n",
|
fprintf(stderr, "Running netselect to choose %d out of %d address%s.\n",
|
||||||
num_score, numhosts, numhosts==1 ? "" : "es");
|
num_score, numhosts, numhosts==1 ? "" : "es");
|
||||||
|
@ -45,7 +22,7 @@
|
||||||
/* keep going until most of the hosts have been finished */
|
/* keep going until most of the hosts have been finished */
|
||||||
must_continue = numhosts;
|
must_continue = numhosts;
|
||||||
while (must_continue && must_continue >= numhosts/2)
|
while (must_continue && must_continue >= numhosts/2)
|
||||||
@@ -774,7 +779,7 @@ static void send_probe(int seq, int ttl, OPacket *op,
|
@@ -774,7 +780,7 @@ static void send_probe(int seq, int ttl, OPacket *op,
|
||||||
ip->ip_off = 0;
|
ip->ip_off = 0;
|
||||||
ip->ip_hl = sizeof(*ip) >> 2;
|
ip->ip_hl = sizeof(*ip) >> 2;
|
||||||
ip->ip_p = IPPROTO_UDP;
|
ip->ip_p = IPPROTO_UDP;
|
||||||
|
@ -54,7 +31,7 @@
|
||||||
ip->ip_ttl = ttl;
|
ip->ip_ttl = ttl;
|
||||||
ip->ip_v = IPVERSION;
|
ip->ip_v = IPVERSION;
|
||||||
ip->ip_id = htons(ident + seq);
|
ip->ip_id = htons(ident + seq);
|
||||||
@@ -905,11 +910,7 @@ static HostData *wait_for_reply(HostData *hosts, int n
|
@@ -905,11 +911,7 @@ static HostData *wait_for_reply(HostData *hosts, int n
|
||||||
time_t msec_used;
|
time_t msec_used;
|
||||||
HostData *host;
|
HostData *host;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue