Home | History | Annotate | Download | only in test
      1 /* Test invoked by tlsdated instead of tlsdate to
      2  * show allow arbitrary delays before returning a
      3  * "sane" time. This makes for easy timeout testing.
      4  */
      5 #include "config.h"
      6 
      7 #include <stdio.h>
      8 #include <stdlib.h>
      9 #include <unistd.h>
     10 
     11 int main (int argc, char *argv[])
     12 {
     13   /* Unsigned int to match what tlsdate -Vraw returns, not time_t */
     14   unsigned int t = RECENT_COMPILE_DATE + 1;
     15   if (argc < 2)
     16     return 1;
     17   sleep (atoi (argv[1]));
     18   fwrite (&t, sizeof (t), 1, stdout);
     19   return 0;
     20 }
     21