summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcheloha <>2018-07-13 18:36:56 +0000
committercheloha <>2018-07-13 18:36:56 +0000
commit4ffff01bec4bc66afd2ef22fba624a0d3cffdc04 (patch)
tree59b9811cbdf2d09e36af97ea0c076544d116dd13 /src
parent2784227e885350759036fb7b1ecc5b560746db18 (diff)
downloadopenbsd-4ffff01bec4bc66afd2ef22fba624a0d3cffdc04.tar.gz
openbsd-4ffff01bec4bc66afd2ef22fba624a0d3cffdc04.tar.bz2
openbsd-4ffff01bec4bc66afd2ef22fba624a0d3cffdc04.zip
openssl app timers: TM_START -> TM_RESET, TM_STOP -> TM_GET
Much more apt than the current operation names. Names suggested by jca@ ages ago. ok jca, jsing
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/apps.h10
-rw-r--r--src/usr.bin/openssl/apps_posix.c8
-rw-r--r--src/usr.bin/openssl/s_time.c6
-rw-r--r--src/usr.bin/openssl/speed.c6
4 files changed, 15 insertions, 15 deletions
diff --git a/src/usr.bin/openssl/apps.h b/src/usr.bin/openssl/apps.h
index d02169b8aa..cfc6036ccf 100644
--- a/src/usr.bin/openssl/apps.h
+++ b/src/usr.bin/openssl/apps.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: apps.h,v 1.20 2017/12/05 15:02:06 jca Exp $ */ 1/* $OpenBSD: apps.h,v 1.21 2018/07/13 18:36:56 cheloha Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -277,10 +277,10 @@ unsigned char *next_protos_parse(unsigned short *outlen, const char *in);
277 277
278int app_isdir(const char *); 278int app_isdir(const char *);
279 279
280#define TM_START 0 280#define TM_RESET 0
281#define TM_STOP 1 281#define TM_GET 1
282double app_timer_real(int stop); 282double app_timer_real(int);
283double app_timer_user(int stop); 283double app_timer_user(int);
284 284
285#define OPENSSL_NO_SSL_INTERN 285#define OPENSSL_NO_SSL_INTERN
286 286
diff --git a/src/usr.bin/openssl/apps_posix.c b/src/usr.bin/openssl/apps_posix.c
index 502919c0a2..cdcf821366 100644
--- a/src/usr.bin/openssl/apps_posix.c
+++ b/src/usr.bin/openssl/apps_posix.c
@@ -124,13 +124,13 @@
124#include "apps.h" 124#include "apps.h"
125 125
126double 126double
127app_timer_real(int stop) 127app_timer_real(int get)
128{ 128{
129 static struct timespec start; 129 static struct timespec start;
130 struct timespec elapsed, now; 130 struct timespec elapsed, now;
131 131
132 clock_gettime(CLOCK_MONOTONIC, &now); 132 clock_gettime(CLOCK_MONOTONIC, &now);
133 if (stop) { 133 if (get) {
134 timespecsub(&now, &start, &elapsed); 134 timespecsub(&now, &start, &elapsed);
135 return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0; 135 return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0;
136 } 136 }
@@ -139,14 +139,14 @@ app_timer_real(int stop)
139} 139}
140 140
141double 141double
142app_timer_user(int stop) 142app_timer_user(int get)
143{ 143{
144 static struct timeval start; 144 static struct timeval start;
145 struct timeval elapsed; 145 struct timeval elapsed;
146 struct rusage now; 146 struct rusage now;
147 147
148 getrusage(RUSAGE_SELF, &now); 148 getrusage(RUSAGE_SELF, &now);
149 if (stop) { 149 if (get) {
150 timersub(&now.ru_utime, &start, &elapsed); 150 timersub(&now.ru_utime, &start, &elapsed);
151 return elapsed.tv_sec + elapsed.tv_usec / 1000000.0; 151 return elapsed.tv_sec + elapsed.tv_usec / 1000000.0;
152 } 152 }
diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c
index ed89160b23..0d0b771281 100644
--- a/src/usr.bin/openssl/s_time.c
+++ b/src/usr.bin/openssl/s_time.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s_time.c,v 1.23 2018/02/07 05:47:55 jsing Exp $ */ 1/* $OpenBSD: s_time.c,v 1.24 2018/07/13 18:36:56 cheloha Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -228,8 +228,8 @@ s_time_usage(void)
228/*********************************************************************** 228/***********************************************************************
229 * TIME - time functions 229 * TIME - time functions
230 */ 230 */
231#define START 0 231#define START TM_RESET
232#define STOP 1 232#define STOP TM_GET
233 233
234static double 234static double
235tm_Time_F(int op) 235tm_Time_F(int op)
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index a21f67b5cf..3d226a204e 100644
--- a/src/usr.bin/openssl/speed.c
+++ b/src/usr.bin/openssl/speed.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: speed.c,v 1.22 2018/02/07 05:47:55 jsing Exp $ */ 1/* $OpenBSD: speed.c,v 1.23 2018/07/13 18:36:56 cheloha Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -195,8 +195,8 @@ sig_done(int sig)
195 run = 0; 195 run = 0;
196} 196}
197 197
198#define START 0 198#define START TM_RESET
199#define STOP 1 199#define STOP TM_GET
200 200
201 201
202static double 202static double