]> andersk Git - moira.git/blobdiff - clients/mrcheck/mrcheck.c
Win32 portability mods for Pismere.
[moira.git] / clients / mrcheck / mrcheck.c
index 8d64a42fabf7e620b20f0845f6e821fd1c707f58..e82856880d9ce30520e51409453fef457b609e9f 100644 (file)
@@ -12,8 +12,6 @@
 #include <moira_site.h>
 #include <mrclient.h>
 
-#include <sys/time.h>
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -30,7 +28,7 @@ void usage(void);
 
 char *whoami;
 static int count = 0;
-static struct timeval now;
+static time_t now;
 
 struct service {
   char name[17];
@@ -78,7 +76,7 @@ int process_server(int argc, char **argv, void *sqv)
     disp_svc(argv, "Should this be enabled?\n");
   else if (atoi(argv[SVC_ENABLE]) &&
           60 * atoi(argv[SVC_INTERVAL]) + 86400 + atoi(argv[SVC_DFCHECK])
-          < now.tv_sec)
+          < now)
     disp_svc(argv, "Service has not been updated\n");
 
   return MR_CONT;
@@ -130,7 +128,7 @@ int process_host(int argc, char **argv, void *sqv)
     disp_sh(argv, "Should this be enabled?\n");
   else if (atoi(argv[SH_ENABLE]) && update_int &&
           60 * atoi(update_int) + 86400 + atoi(argv[SH_LASTSUCCESS])
-          < now.tv_sec)
+          < now)
     disp_sh(argv, "Host has not been updated\n");
 
   return MR_CONT;
@@ -187,7 +185,7 @@ int main(int argc, char *argv[])
       goto punt;
     }
 
-  gettimeofday(&now, 0);
+  now = time(NULL);
   sq = sq_create();
 
   /* Check services first */
This page took 0.398562 seconds and 4 git commands to generate.