X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdso%2Fdso_vms.c;h=654e766764fd0dc64b79f1493136fef812762019;hp=ffdc57f824277c8e17bc6c5312c7ae8a634c4197;hb=e0d32e98f00cfd39977593ae1bc6cfd2ab6bbb0e;hpb=b39fc560612984e65ec30d7f37487303bf514fb3 diff --git a/crypto/dso/dso_vms.c b/crypto/dso/dso_vms.c index ffdc57f824..654e766764 100644 --- a/crypto/dso/dso_vms.c +++ b/crypto/dso/dso_vms.c @@ -1,4 +1,3 @@ -/* dso_vms.c -*- mode:C; c-file-style: "eay" -*- */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2000. @@ -57,26 +56,19 @@ * */ -#include -#include -#include -#include "internal/cryptlib.h" -#include +#include "dso_locl.h" -#ifndef OPENSSL_SYS_VMS -DSO_METHOD *DSO_METHOD_vms(void) -{ - return NULL; -} -#else +#ifdef OPENSSL_SYS_VMS # pragma message disable DOLLARID +# include # include # include +# include # include # include # include -# include "vms_rms.h" +# include "../vms_rms.h" /* Some compiler options may mask the declaration of "_malloc32". */ # if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE @@ -93,7 +85,6 @@ void *_malloc32(__size_t); static int vms_load(DSO *dso); static int vms_unload(DSO *dso); -static void *vms_bind_var(DSO *dso, const char *symname); static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname); static char *vms_name_converter(DSO *dso, const char *filename); static char *vms_merger(DSO *dso, const char *filespec1, @@ -103,7 +94,6 @@ static DSO_METHOD dso_meth_vms = { "OpenSSL 'VMS' shared library method", vms_load, NULL, /* unload */ - vms_bind_var, vms_bind_func, NULL, /* ctrl */ vms_name_converter, @@ -133,9 +123,9 @@ typedef struct dso_internal_st { char imagename[NAMX_MAXRSS + 1]; } DSO_VMS_INTERNAL; -DSO_METHOD *DSO_METHOD_vms(void) +DSO_METHOD *DSO_METHOD_openssl(void) { - return (&dso_meth_vms); + return &dso_meth_vms; } static int vms_load(DSO *dso) @@ -324,11 +314,10 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym) { DSO_VMS_INTERNAL *ptr; int status; -# if 0 - int flags = (1 << 4); /* LIB$M_FIS_MIXEDCASE, but this symbol isn't - * defined in VMS older than 7.0 or so */ +# ifdef LIB$M_FIS_MIXEDCASE + int flags = LIB$M_FIS_MIXEDCASE; # else - int flags = 0; + int flags = (1 << 4); # endif struct dsc$descriptor_s symname_dsc; @@ -413,13 +402,6 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym) return; } -static void *vms_bind_var(DSO *dso, const char *symname) -{ - void *sym = 0; - vms_bind_sym(dso, symname, &sym); - return sym; -} - static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname) { DSO_FUNC_TYPE sym = 0; @@ -512,7 +494,7 @@ static char *vms_merger(DSO *dso, const char *filespec1, } merged = OPENSSL_malloc(nam.NAMX_ESL + 1); - if (!merged) + if (merged == NULL) goto malloc_err; strncpy(merged, nam.NAMX_ESA, nam.NAMX_ESL); merged[nam.NAMX_ESL] = '\0'; @@ -525,7 +507,7 @@ static char *vms_name_converter(DSO *dso, const char *filename) { int len = strlen(filename); char *not_translated = OPENSSL_malloc(len + 1); - if (not_translated) + if (not_translated != NULL) strcpy(not_translated, filename); return (not_translated); }