]> git.meshlink.io Git - utcp/blobdiff - test.c
Use clock_gettime() instead of gettimeofday().
[utcp] / test.c
diff --git a/test.c b/test.c
index 300ce51e4d3a0cb8f636038a7ca8b766f4c7e39c..2a273de70463dbe4f39117cc50ed438dc46c4834 100644 (file)
--- a/test.c
+++ b/test.c
@@ -291,7 +291,7 @@ int main(int argc, char *argv[]) {
 
        char buf[102400];
 
-       struct timeval timeout = utcp_timeout(u);
+       struct timespec timeout = utcp_timeout(u);
 
        while(!connected || utcp_is_active(u)) {
                size_t max = c ? utcp_get_sndbuf_free(c) : 0;
@@ -304,7 +304,7 @@ int main(int argc, char *argv[]) {
                        max = read_size;
                }
 
-               int timeout_ms = timeout.tv_sec * 1000 + timeout.tv_usec / 1000 + 1;
+               int timeout_ms = timeout.tv_sec * 1000 + timeout.tv_nsec / 1000000 + 1;
 
                debug("polling, dir = %d, timeout = %d\n", dir, timeout_ms);