diff options
-rw-r--r-- | AK/Time.h | 6 | ||||
-rw-r--r-- | LibC/sys/time.h | 6 | ||||
-rw-r--r-- | LibC/sys/types.h | 5 | ||||
-rw-r--r-- | LibCore/CElapsedTimer.h | 2 | ||||
-rw-r--r-- | LibCore/CEventLoop.h | 3 | ||||
-rw-r--r-- | LibCore/CIODevice.cpp | 5 | ||||
-rwxr-xr-x | Ports/.port_include.sh | 1 | ||||
-rw-r--r-- | Servers/LookupServer/main.cpp | 22 | ||||
-rw-r--r-- | Userland/tc.cpp | 9 | ||||
-rw-r--r-- | Userland/uc.cpp | 9 |
10 files changed, 38 insertions, 30 deletions
@@ -2,7 +2,8 @@ namespace AK { -inline void timeval_sub(const struct timeval* a, const struct timeval* b, struct timeval* result) +template<typename TimevalType> +inline void timeval_sub(const TimevalType* a, const TimevalType* b, TimevalType* result) { result->tv_sec = a->tv_sec - b->tv_sec; result->tv_usec = a->tv_usec - b->tv_usec; @@ -12,7 +13,8 @@ inline void timeval_sub(const struct timeval* a, const struct timeval* b, struct } } -inline void timeval_add(const struct timeval* a, const struct timeval* b, struct timeval* result) +template<typename TimevalType> +inline void timeval_add(const TimevalType* a, const TimevalType* b, TimevalType* result) { result->tv_sec = a->tv_sec + b->tv_sec; result->tv_usec = a->tv_usec + b->tv_usec; diff --git a/LibC/sys/time.h b/LibC/sys/time.h index 9d93686923..fef0236f82 100644 --- a/LibC/sys/time.h +++ b/LibC/sys/time.h @@ -1,9 +1,15 @@ #pragma once #include <sys/cdefs.h> +#include <sys/types.h> __BEGIN_DECLS +struct timeval { + time_t tv_sec; + suseconds_t tv_usec; +}; + struct timezone { int tz_minuteswest; int tz_dsttime; diff --git a/LibC/sys/types.h b/LibC/sys/types.h index 7cb759328a..dc55ad488e 100644 --- a/LibC/sys/types.h +++ b/LibC/sys/types.h @@ -37,11 +37,6 @@ typedef uint32_t clock_t; #define __socklen_t uint32_t typedef __socklen_t socklen_t; -struct timeval { - time_t tv_sec; - suseconds_t tv_usec; -}; - struct stat { dev_t st_dev; /* ID of device containing file */ ino_t st_ino; /* inode number */ diff --git a/LibCore/CElapsedTimer.h b/LibCore/CElapsedTimer.h index b7aa84bfee..bb8fa28ac6 100644 --- a/LibCore/CElapsedTimer.h +++ b/LibCore/CElapsedTimer.h @@ -1,6 +1,6 @@ #pragma once -#include <time.h> +#include <sys/time.h> class CElapsedTimer { public: diff --git a/LibCore/CEventLoop.h b/LibCore/CEventLoop.h index 31a0d21a48..a44cc72486 100644 --- a/LibCore/CEventLoop.h +++ b/LibCore/CEventLoop.h @@ -1,12 +1,13 @@ #pragma once -#include <LibCore/CLock.h> #include <AK/Badge.h> #include <AK/HashMap.h> #include <AK/OwnPtr.h> #include <AK/Vector.h> #include <AK/WeakPtr.h> +#include <LibCore/CLock.h> #include <sys/select.h> +#include <sys/time.h> #include <time.h> class CEvent; diff --git a/LibCore/CIODevice.cpp b/LibCore/CIODevice.cpp index c4a5437aeb..bf1fdb68b2 100644 --- a/LibCore/CIODevice.cpp +++ b/LibCore/CIODevice.cpp @@ -1,7 +1,8 @@ #include <LibCore/CIODevice.h> -#include <unistd.h> -#include <sys/select.h> #include <stdio.h> +#include <sys/select.h> +#include <sys/time.h> +#include <unistd.h> #include <AK/printf.cpp> CIODevice::CIODevice(CObject* parent) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 1a5de96130..50f3f7ca3b 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -35,6 +35,7 @@ function run_fetch_git() { if [ -d "$PORT_DIR/.git" ]; then run_command git fetch run_command git reset --hard FETCH_HEAD + run_command git clean -fx else run_command_nocd git clone "$1" "$PORT_DIR" fi diff --git a/Servers/LookupServer/main.cpp b/Servers/LookupServer/main.cpp index 2deaf273ea..11e2ab49d0 100644 --- a/Servers/LookupServer/main.cpp +++ b/Servers/LookupServer/main.cpp @@ -1,19 +1,19 @@ +#include "DNSPacket.h" +#include "DNSRecord.h" +#include <AK/AKString.h> +#include <AK/BufferStream.h> +#include <AK/ByteBuffer.h> +#include <AK/HashMap.h> +#include <Kernel/Net/IPv4.h> +#include <LibCore/CConfigFile.h> +#include <arpa/inet.h> +#include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <sys/select.h> #include <sys/socket.h> -#include <arpa/inet.h> -#include <netinet/in.h> -#include <unistd.h> +#include <sys/time.h> #include <unistd.h> -#include <Kernel/Net/IPv4.h> -#include <AK/AKString.h> -#include <AK/HashMap.h> -#include <AK/ByteBuffer.h> -#include <AK/BufferStream.h> -#include "DNSPacket.h" -#include "DNSRecord.h" -#include <LibCore/CConfigFile.h> #define T_A 1 #define T_NS 2 diff --git a/Userland/tc.cpp b/Userland/tc.cpp index 374d61474c..b19aa2a98e 100644 --- a/Userland/tc.cpp +++ b/Userland/tc.cpp @@ -1,11 +1,12 @@ +#include <arpa/inet.h> +#include <netinet/in.h> #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> -#include <sys/types.h> #include <sys/socket.h> -#include <arpa/inet.h> -#include <netinet/in.h> +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> int main(int argc, char** argv) { diff --git a/Userland/uc.cpp b/Userland/uc.cpp index 672854d12e..c5aabda29d 100644 --- a/Userland/uc.cpp +++ b/Userland/uc.cpp @@ -1,11 +1,12 @@ +#include <arpa/inet.h> +#include <netinet/in.h> #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> -#include <sys/types.h> #include <sys/socket.h> -#include <arpa/inet.h> -#include <netinet/in.h> +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> int main(int argc, char** argv) { |