summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-11-04 14:24:42 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-11-04 14:24:42 +0000
commit2b62f1b58b2042f4d057215fb3002fba29e25946 (patch)
tree1c97ccc48607f8506631b067f7b52a23d5a26a09 /usr.sbin
parentc8a6cc7867a805d13e59b6e6d1fa1a619d8a7ad1 (diff)
Move and promote getmonotime() to an internal API function.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpki-client/extern.h3
-rw-r--r--usr.sbin/rpki-client/http.c12
-rw-r--r--usr.sbin/rpki-client/main.c12
3 files changed, 14 insertions, 13 deletions
diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h
index f0636833fdf..35efc809bd3 100644
--- a/usr.sbin/rpki-client/extern.h
+++ b/usr.sbin/rpki-client/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.92 2021/11/04 14:21:19 claudio Exp $ */
+/* $OpenBSD: extern.h,v 1.93 2021/11/04 14:24:41 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -599,6 +599,7 @@ int output_json(FILE *, struct vrp_tree *, struct brk_tree *,
void logx(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
+time_t getmonotime(void);
int mkpath(const char *);
diff --git a/usr.sbin/rpki-client/http.c b/usr.sbin/rpki-client/http.c
index 25d951ae302..f564e510e40 100644
--- a/usr.sbin/rpki-client/http.c
+++ b/usr.sbin/rpki-client/http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: http.c,v 1.47 2021/11/03 13:29:28 claudio Exp $ */
+/* $OpenBSD: http.c,v 1.48 2021/11/04 14:24:41 claudio Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
@@ -193,16 +193,6 @@ static enum res proxy_read(struct http_connection *);
static enum res proxy_write(struct http_connection *);
static enum res data_write(struct http_connection *);
-static time_t
-getmonotime(void)
-{
- struct timespec ts;
-
- if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
- err(1, "clock_gettime");
- return (ts.tv_sec);
-}
-
/*
* Return a string that can be used in error message to identify the
* connection.
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c
index 0da458ebf52..c11a28b3122 100644
--- a/usr.sbin/rpki-client/main.c
+++ b/usr.sbin/rpki-client/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.161 2021/11/04 11:32:55 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.162 2021/11/04 14:24:41 claudio Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -86,6 +86,16 @@ logx(const char *fmt, ...)
}
}
+time_t
+getmonotime(void)
+{
+ struct timespec ts;
+
+ if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0)
+ err(1, "clock_gettime");
+ return (ts.tv_sec);
+}
+
void
entity_free(struct entity *ent)
{