Commit 9e1013d8 authored by robertdavidgraham's avatar robertdavidgraham
Browse files

fixes

parent 53a454f5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -318,11 +318,11 @@ static unsigned
hexval(char c)
{
    if ('0' <= c && c <= '9')
        return c - '0';
        return (unsigned)(c - '0');
    if ('a' <= c && c <= 'f')
        return c - 'a' + 10;
        return (unsigned)(c - 'a' + 10);
    if ('A' <= c && c <= 'F')
        return c - 'A' + 10;
        return (unsigned)(c - 'A' + 10);
    return 0xFF;
}

+1 −1
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ initialize_adapter(struct Masscan *masscan,
                (router_ipv4>> 0)&0xFF
                );

            err = arp_resolve_sync(
            arp_resolve_sync(
                    masscan->adapter,
                    *r_adapter_ip,
                    adapter_mac,
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ pixie_begin_thread(
    
	typedef void *(*PTHREADFUNC)(void*);
	pthread_t thread_id;
	return pthread_create(
	return (size_t)pthread_create(
                          &thread_id, 
                          NULL, 
                          (PTHREADFUNC)worker_thread, 
+18 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <time.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>


#if defined(WIN32)
@@ -130,9 +131,24 @@ port_usleep(uint64_t waitTime)
#elif defined(CLOCK_MONOTONIC)
#include <unistd.h>

void port_usleep(uint64_t microseconds)
void
port_usleep(uint64_t microseconds)
{
    usleep(microseconds);
    struct timespec ts;
    struct timespec remaining;
    int err;

    ts.tv_sec  =  microseconds/1000000;
    ts.tv_nsec = (microseconds%1000000) * 1000;

again:
    err = nanosleep(&ts, &remaining);
    if (err == -1 && errno == EINTR) {
        memcpy(&ts, &remaining, sizeof(ts));
        goto again;
    }

    //usleep(microseconds);
}
uint64_t
port_gettime()
+1 −1
Original line number Diff line number Diff line
@@ -339,7 +339,7 @@ parse_prism_header:
    {
		unsigned header_length;
        VERIFY_REMAINING(8, FOUND_PRISM);
		header_length = ex32le(px+4);
		
		if (ex32le(px+offset+0) != 0x00000044)
            return 0;
		header_length = ex32le(px+offset+4);
Loading