]> granicus.if.org Git - vnstat/commitdiff
force interface counter sync after database import
authorTeemu Toivola <git@humdi.net>
Thu, 14 May 2015 14:51:39 +0000 (17:51 +0300)
committerTeemu Toivola <git@humdi.net>
Thu, 14 May 2015 14:51:39 +0000 (17:51 +0300)
src/vnstat.c

index 66db0931566ec1188e0cb6975185bbf4aa6a6436..da04e68403df6d336d35a3f1f5880bc124aef711 100644 (file)
@@ -579,6 +579,8 @@ void handleimport(PARAMS *p)
                printf("Error: validation of imported database failed.\n");
                exit(EXIT_FAILURE);
        }
+       /* set boot time to zero in order to force counter sync */
+       data.btime = 0;
        strncpy_nt(data.interface, p->interface, 32);
        if (writedb(p->interface, p->dirname, 1)) {
                printf("Database import for \"%s\" completed.\n", data.interface);