-/* $OpenBSD: extern.h,v 1.206 2024/02/21 12:38:10 tb Exp $ */
+/* $OpenBSD: extern.h,v 1.207 2024/02/21 12:48:25 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
int output_ometric(FILE *, struct vrp_tree *, struct brk_tree *,
struct vap_tree *, struct stats *);
-void logx(const char *fmt, ...)
+void logx(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
-time_t getmonotime(void);
+time_t getmonotime(void);
+time_t get_current_time(void);
int mkpath(const char *);
int mkpathat(int, const char *);
/* Maximum number of delegated hosting locations (repositories) for each TAL. */
#define MAX_REPO_PER_TAL 1000
-/*
- * Time - Evaluation time is used as the current time if it is
- * larger than X509_TIME_MIN, otherwise the system time is used.
- */
-#define X509_TIME_MAX 253402300799LL
-#define X509_TIME_MIN -62167219200LL
-extern time_t get_current_time(void);
-
#endif /* ! EXTERN_H */
-/* $OpenBSD: main.c,v 1.249 2024/02/16 11:55:42 tb Exp $ */
+/* $OpenBSD: main.c,v 1.250 2024/02/21 12:48:25 tb Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
int repo_timeout;
time_t deadline;
+/* 9999-12-31 23:59:59 UTC */
+#define X509_TIME_MAX 253402300799LL
+/* 0000-01-01 00:00:00 UTC */
+#define X509_TIME_MIN -62167219200LL
+
int64_t evaluation_time = X509_TIME_MIN;
struct stats stats;
return (ts.tv_sec);
}
+/*
+ * Time - Evaluation time is used as the current time if it is
+ * larger than X509_TIME_MIN, otherwise the system time is used.
+ */
+time_t
+get_current_time(void)
+{
+ if (evaluation_time > X509_TIME_MIN)
+ return (time_t)evaluation_time;
+ return time(NULL);
+}
+
void
entity_free(struct entity *ent)
{
free(ent);
}
-time_t
-get_current_time(void)
-{
- if (evaluation_time > X509_TIME_MIN)
- return (time_t)evaluation_time;
- return time(NULL);
-}
-
/*
* Read a queue entity from the descriptor.
* Matched by entity_write_req().