X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=apps%2Flib%2Fapps.c;h=087ef4ec84427d9d215861c17b255211fd9d42b4;hb=e306f83c8cfc7ac970d04a36c90634ab8573a594;hp=497081c1530d30226409f8b17b548fffb6bdc45a;hpb=2bd928a1bff7e39070992df1876b8d9ea9634301;p=openssl.git diff --git a/apps/lib/apps.c b/apps/lib/apps.c index 497081c153..087ef4ec84 100644 --- a/apps/lib/apps.c +++ b/apps/lib/apps.c @@ -671,16 +671,24 @@ static int load_certs_crls(const char *file, int format, return rv; } +void app_bail_out(char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + BIO_vprintf(bio_err, fmt, args); + va_end(args); + ERR_print_errors(bio_err); + exit(1); +} + void* app_malloc(int sz, const char *what) { void *vp = OPENSSL_malloc(sz); - if (vp == NULL) { - BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n", - opt_getprog(), sz, what); - ERR_print_errors(bio_err); - exit(1); - } + if (vp == NULL) + app_bail_out("%s: Could not allocate %d bytes for %s\n", + opt_getprog(), sz, what); return vp; } @@ -2230,40 +2238,6 @@ double app_tminterval(int stop, int usertime) return ret; } -#elif defined(OPENSSL_SYSTEM_VMS) -# include -# include - -double app_tminterval(int stop, int usertime) -{ - static clock_t tmstart; - double ret = 0; - clock_t now; -# ifdef __TMS - struct tms rus; - - now = times(&rus); - if (usertime) - now = rus.tms_utime; -# else - if (usertime) - now = clock(); /* sum of user and kernel times */ - else { - struct timeval tv; - gettimeofday(&tv, NULL); - now = (clock_t)((unsigned long long)tv.tv_sec * CLK_TCK + - (unsigned long long)tv.tv_usec * (1000000 / CLK_TCK) - ); - } -# endif - if (stop == TM_START) - tmstart = now; - else - ret = (now - tmstart) / (double)(CLK_TCK); - - return ret; -} - #elif defined(_SC_CLK_TCK) /* by means of unistd.h */ # include