]> git.meshlink.io Git - meshlink/commitdiff
Update UTCP to the latest commit, which changes the return value of utcp_timeout().
authorGuus Sliepen <guus@meshlink.io>
Fri, 5 Dec 2014 21:30:14 +0000 (22:30 +0100)
committerGuus Sliepen <guus@meshlink.io>
Sat, 27 Dec 2014 17:39:22 +0000 (18:39 +0100)
Conflicts:
src/utcp

src/meshlink.c
src/utcp

index 51590200078252a96b4afcf3e14ccd6ab5e67299..994d8957ae696fe487035345a95f9e8e83cb18d1 100644 (file)
@@ -701,16 +701,15 @@ static bool ecdsa_keygen(meshlink_handle_t *mesh) {
 
 static struct timeval idle(event_loop_t *loop, void *data) {
        meshlink_handle_t *mesh = data;
-       int t, tmin = -1;
+       struct timeval t, tmin = {3600, 0};
        for splay_each(node_t, n, mesh->nodes) {
                if(!n->utcp)
                        continue;
                t = utcp_timeout(n->utcp);
-               if(t >= 0 && t < tmin)
+               if(timercmp(&t, &tmin, <))
                        tmin = t;
        }
-       struct timeval tv = {.tv_sec = t};
-       return tv;
+       return tmin;
 }
 
 static bool meshlink_setup(meshlink_handle_t *mesh) {
index 8d8944f2e16b8d11e54cb79e1d45023e84aed37f..b570e123128f3fafa583bae186fd61429dcb49a7 160000 (submodule)
--- a/src/utcp
+++ b/src/utcp
@@ -1 +1 @@
-Subproject commit 8d8944f2e16b8d11e54cb79e1d45023e84aed37f
+Subproject commit b570e123128f3fafa583bae186fd61429dcb49a7