summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/util.c
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2005-07-25 14:56:43 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2005-07-25 14:56:43 +0000
commitce2cdc01880edacdbb20e3efb83cd3099c90f2db (patch)
tree0bb56487d33ab9f3e335f831b72c6023c516f9c6 /sbin/isakmpd/util.c
parent6ca1287427ca9716792eccce16c25434f581a52c (diff)
output some more information on UI command "S"
ok ho@
Diffstat (limited to 'sbin/isakmpd/util.c')
-rw-r--r--sbin/isakmpd/util.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sbin/isakmpd/util.c b/sbin/isakmpd/util.c
index e03d59710a4..7725226620a 100644
--- a/sbin/isakmpd/util.c
+++ b/sbin/isakmpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.57 2005/04/08 23:15:26 hshoexer Exp $ */
+/* $OpenBSD: util.c,v 1.58 2005/07/25 14:56:42 hshoexer Exp $ */
/* $EOM: util.c,v 1.23 2000/11/23 12:22:08 niklas Exp $ */
/*
@@ -609,6 +609,21 @@ check_file_secrecy_fd(int fd, char *name, size_t *file_size)
return 0;
}
+/* Calculate timeout. Returns -1 on error. */
+long
+get_timeout(struct timeval *timeout)
+{
+ struct timeval now, result;
+
+ if (gettimeofday(&now, NULL) < 0)
+ return -1;
+
+ timersub(timeout, &now, &result);
+
+ return result.tv_sec;
+}
+
+
/* Special for compiling with Boehms GC. See Makefile and sysdep.h */
#if defined (USE_BOEHM_GC)
char *