diff options
| author | bcook <> | 2014-12-03 22:16:02 +0000 |
|---|---|---|
| committer | bcook <> | 2014-12-03 22:16:02 +0000 |
| commit | 8ef61d3ec1c1e78bae48209c6ae8e7c7d103bdea (patch) | |
| tree | e603f3b2b9b847e1ad959cceefe86bfb3d1513d9 /src/usr.bin/openssl/apps.c | |
| parent | 3339178a7b37aca236756b5c97ee1a4fe72c768f (diff) | |
| download | openbsd-8ef61d3ec1c1e78bae48209c6ae8e7c7d103bdea.tar.gz openbsd-8ef61d3ec1c1e78bae48209c6ae8e7c7d103bdea.tar.bz2 openbsd-8ef61d3ec1c1e78bae48209c6ae8e7c7d103bdea.zip | |
Move Windows OS-specific functions to make porting easier.
Several functions that need to be redefined for a Windows port are right
in the middle of other code that is relatively portable. This patch
isolates the functions that need Windows-specific implementations so
they can be built conditionally in the portable tree.
Add calls to BIO_sock_init() as-needed to openssl(1) so that socket IO works on
Windows. Sorry, these are no-op on other platforms.
ok jsing@ deraadt@
Diffstat (limited to 'src/usr.bin/openssl/apps.c')
| -rw-r--r-- | src/usr.bin/openssl/apps.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index 78555528b6..a042f074f9 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: apps.c,v 1.12 2014/11/07 14:16:48 jsing Exp $ */ | 1 | /* $OpenBSD: apps.c,v 1.13 2014/12/03 22:16:02 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -2205,27 +2205,6 @@ next_protos_parse(unsigned short *outlen, const char *in) | |||
| 2205 | #endif | 2205 | #endif |
| 2206 | /* !OPENSSL_NO_NEXTPROTONEG */ | 2206 | /* !OPENSSL_NO_NEXTPROTONEG */ |
| 2207 | 2207 | ||
| 2208 | double | ||
| 2209 | app_tminterval(int stop, int usertime) | ||
| 2210 | { | ||
| 2211 | double ret = 0; | ||
| 2212 | struct tms rus; | ||
| 2213 | clock_t now = times(&rus); | ||
| 2214 | static clock_t tmstart; | ||
| 2215 | |||
| 2216 | if (usertime) | ||
| 2217 | now = rus.tms_utime; | ||
| 2218 | |||
| 2219 | if (stop == TM_START) | ||
| 2220 | tmstart = now; | ||
| 2221 | else { | ||
| 2222 | long int tck = sysconf(_SC_CLK_TCK); | ||
| 2223 | ret = (now - tmstart) / (double) tck; | ||
| 2224 | } | ||
| 2225 | |||
| 2226 | return (ret); | ||
| 2227 | } | ||
| 2228 | |||
| 2229 | int | 2208 | int |
| 2230 | app_isdir(const char *name) | 2209 | app_isdir(const char *name) |
| 2231 | { | 2210 | { |
| @@ -2341,7 +2320,7 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed) | |||
| 2341 | if (opt->func(opt, NULL) != 0) | 2320 | if (opt->func(opt, NULL) != 0) |
| 2342 | return (1); | 2321 | return (1); |
| 2343 | break; | 2322 | break; |
| 2344 | 2323 | ||
| 2345 | case OPTION_FLAG: | 2324 | case OPTION_FLAG: |
| 2346 | *opt->opt.flag = 1; | 2325 | *opt->opt.flag = 1; |
| 2347 | break; | 2326 | break; |
