summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-04-19 20:57:26 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-04-19 20:57:26 +0000
commit3ba54076295ec1f92965bfa69997ccc94b87be65 (patch)
treea748962ca33c9b84dd79c10b2bf5b4f330199ccd /sbin
parent77f92ac9802a0c39d9d16beda642076940e16924 (diff)
./timer.c: Merge with EOM 1.11
Add LOG_REPORT to always go to logchannel regardless of level; misc small fixes Added timer_report 1999 copyrights
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/timer.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/sbin/isakmpd/timer.c b/sbin/isakmpd/timer.c
index 4d564b4c1e5..bb7abbc09b6 100644
--- a/sbin/isakmpd/timer.c
+++ b/sbin/isakmpd/timer.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: timer.c,v 1.4 1999/02/26 03:50:50 niklas Exp $ */
-/* $EOM: timer.c,v 1.8 1999/02/25 11:39:23 niklas Exp $ */
+/* $OpenBSD: timer.c,v 1.5 1999/04/19 20:57:25 niklas Exp $ */
+/* $EOM: timer.c,v 1.11 1999/04/13 20:00:41 ho Exp $ */
/*
- * Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
+ * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -127,3 +127,18 @@ timer_remove_event (struct event *ev)
TAILQ_REMOVE (&events, ev, link);
free (ev);
}
+
+void
+timer_report (void)
+{
+ struct event *ev;
+ struct timeval now;
+
+ gettimeofday (&now, 0);
+
+ for (ev = TAILQ_FIRST (&events); ev; ev = TAILQ_NEXT (ev, link))
+ log_debug (LOG_REPORT, 0,
+ "timer_report: event %s(%p) scheduled in %d seconds",
+ (ev->name ? ev->name : "<unknown>"), ev,
+ (int)(ev->expiration.tv_sec - now.tv_sec));
+}