]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - test-suite/waiter.c
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / test-suite / waiter.c
index d86637f8eabf8404ec45ffe082ad9bf366d403a6..e8ed9926aea3c233edd153dd13d2ab5e61a2dead 100644 (file)
@@ -1,24 +1,36 @@
-#include <sys/time.h>
+/*
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
+#include "squid.h"
+
+#if HAVE_ASSERT_H
 #include <assert.h>
+#endif
 
 int
 main(int argc, char *argv[])
 {
-       int i;
-       struct timeval now;
-       struct timeval alarm;
-       struct timeval to;
-       assert(argc == 2);
-       i = atoi(argv[1]);
-       gettimeofday(&now, NULL);
-       alarm.tv_sec = now.tv_sec + i + (now.tv_sec % i);
-       alarm.tv_usec = 0;
-       to.tv_sec = alarm.tv_sec - now.tv_sec;
-       to.tv_usec = alarm.tv_usec - now.tv_usec;
-       if (to.tv_usec < 0) {
-               to.tv_usec += 1000000;
-               to.tv_sec -= 1;
-       }
-       select(1, NULL, NULL, NULL, &to);
-       return 0;
+    int i;
+    struct timeval now;
+    struct timeval alarm;
+    struct timeval to;
+    assert(argc == 2);
+    i = atoi(argv[1]);
+    gettimeofday(&now, NULL);
+    alarm.tv_sec = now.tv_sec + i + (now.tv_sec % i);
+    alarm.tv_usec = 0;
+    to.tv_sec = alarm.tv_sec - now.tv_sec;
+    to.tv_usec = alarm.tv_usec - now.tv_usec;
+    if (to.tv_usec < 0) {
+        to.tv_usec += 1000000;
+        to.tv_sec -= 1;
+    }
+    select(1, NULL, NULL, NULL, &to);
+    return 0;
 }
+