X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=osdd.c;h=f5cd44f776b31819ae9665805aa0329a35a21a63;hb=0ab80500fd3a7e262417c707022dffbcd8655ba6;hp=15836ea51b7d36377197c5a94fd307bdb16b64e1;hpb=6b0069005ee1fc055a16983d675dc13db38170af;p=osdd.git diff --git a/osdd.c b/osdd.c index 15836ea..f5cd44f 100644 --- a/osdd.c +++ b/osdd.c @@ -8,20 +8,17 @@ #include #include #include -#include #include #include -#include #include #include #include #undef DEBUG -#include "util.h" +#include "osd.h" static xosd *osd; -typedef uint64_t timestamp_t; static timestamp_t now; /*** Options ***/ @@ -246,10 +243,7 @@ main(int argc, char **argv) { pid_t pid = fork(); if (pid < 0) - { - fprintf(stderr, "batt: Cannot fork: %m\n"); - return 1; - } + die("Cannot fork: %m"); if (pid > 0) return 0; setsid(); @@ -274,9 +268,7 @@ main(int argc, char **argv) for (;;) { - struct timeval tv; - gettimeofday(&tv, NULL); - now = (timestamp_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; + now = get_current_time(); timestamp_t wait_until = now - 1; if (!current_msg && first_msg)