diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bss_log.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bss_log.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c index 7ead044b37..b7dce5c1a2 100644 --- a/src/lib/libcrypto/bio/bss_log.c +++ b/src/lib/libcrypto/bio/bss_log.c | |||
| @@ -75,6 +75,15 @@ | |||
| 75 | # include <descrip.h> | 75 | # include <descrip.h> |
| 76 | # include <lib$routines.h> | 76 | # include <lib$routines.h> |
| 77 | # include <starlet.h> | 77 | # include <starlet.h> |
| 78 | /* Some compiler options may mask the declaration of "_malloc32". */ | ||
| 79 | # if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE | ||
| 80 | # if __INITIAL_POINTER_SIZE == 64 | ||
| 81 | # pragma pointer_size save | ||
| 82 | # pragma pointer_size 32 | ||
| 83 | void * _malloc32 (__size_t); | ||
| 84 | # pragma pointer_size restore | ||
| 85 | # endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 86 | # endif /* __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE */ | ||
| 78 | #elif defined(__ultrix) | 87 | #elif defined(__ultrix) |
| 79 | # include <sys/syslog.h> | 88 | # include <sys/syslog.h> |
| 80 | #elif defined(OPENSSL_SYS_NETWARE) | 89 | #elif defined(OPENSSL_SYS_NETWARE) |
| @@ -300,7 +309,24 @@ static void xopenlog(BIO* bp, char* name, int level) | |||
| 300 | static void xsyslog(BIO *bp, int priority, const char *string) | 309 | static void xsyslog(BIO *bp, int priority, const char *string) |
| 301 | { | 310 | { |
| 302 | struct dsc$descriptor_s opc_dsc; | 311 | struct dsc$descriptor_s opc_dsc; |
| 312 | |||
| 313 | /* Arrange 32-bit pointer to opcdef buffer and malloc(), if needed. */ | ||
| 314 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 315 | # pragma pointer_size save | ||
| 316 | # pragma pointer_size 32 | ||
| 317 | # define OPCDEF_TYPE __char_ptr32 | ||
| 318 | # define OPCDEF_MALLOC _malloc32 | ||
| 319 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 320 | # define OPCDEF_TYPE char * | ||
| 321 | # define OPCDEF_MALLOC OPENSSL_malloc | ||
| 322 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 323 | |||
| 303 | struct opcdef *opcdef_p; | 324 | struct opcdef *opcdef_p; |
| 325 | |||
| 326 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 327 | # pragma pointer_size restore | ||
| 328 | #endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 329 | |||
| 304 | char buf[10240]; | 330 | char buf[10240]; |
| 305 | unsigned int len; | 331 | unsigned int len; |
| 306 | struct dsc$descriptor_s buf_dsc; | 332 | struct dsc$descriptor_s buf_dsc; |
| @@ -326,8 +352,8 @@ static void xsyslog(BIO *bp, int priority, const char *string) | |||
| 326 | 352 | ||
| 327 | lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); | 353 | lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); |
| 328 | 354 | ||
| 329 | /* we know there's an 8 byte header. That's documented */ | 355 | /* We know there's an 8-byte header. That's documented. */ |
| 330 | opcdef_p = (struct opcdef *) OPENSSL_malloc(8 + len); | 356 | opcdef_p = OPCDEF_MALLOC( 8+ len); |
| 331 | opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; | 357 | opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; |
| 332 | memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); | 358 | memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); |
| 333 | opcdef_p->opc$l_ms_rqstid = 0; | 359 | opcdef_p->opc$l_ms_rqstid = 0; |
| @@ -335,7 +361,7 @@ static void xsyslog(BIO *bp, int priority, const char *string) | |||
| 335 | 361 | ||
| 336 | opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | 362 | opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T; |
| 337 | opc_dsc.dsc$b_class = DSC$K_CLASS_S; | 363 | opc_dsc.dsc$b_class = DSC$K_CLASS_S; |
| 338 | opc_dsc.dsc$a_pointer = (char *)opcdef_p; | 364 | opc_dsc.dsc$a_pointer = (OPCDEF_TYPE) opcdef_p; |
| 339 | opc_dsc.dsc$w_length = len + 8; | 365 | opc_dsc.dsc$w_length = len + 8; |
| 340 | 366 | ||
| 341 | sys$sndopr(opc_dsc, 0); | 367 | sys$sndopr(opc_dsc, 0); |
