aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/des/enc_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/des/enc_read.c')
-rw-r--r--openssl/crypto/des/enc_read.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/openssl/crypto/des/enc_read.c b/openssl/crypto/des/enc_read.c
index e7da2ec66..edb6620d0 100644
--- a/openssl/crypto/des/enc_read.c
+++ b/openssl/crypto/des/enc_read.c
@@ -63,7 +63,7 @@
/* This has some uglies in it but it works - even over sockets. */
/*extern int errno;*/
-OPENSSL_IMPLEMENT_GLOBAL(int,DES_rw_mode)=DES_PCBC_MODE;
+OPENSSL_IMPLEMENT_GLOBAL(int,DES_rw_mode,DES_PCBC_MODE)
/*
@@ -87,6 +87,9 @@ OPENSSL_IMPLEMENT_GLOBAL(int,DES_rw_mode)=DES_PCBC_MODE;
int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
DES_cblock *iv)
{
+#if defined(OPENSSL_NO_POSIX_IO)
+ return(0);
+#else
/* data to be unencrypted */
int net_num=0;
static unsigned char *net=NULL;
@@ -147,7 +150,7 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
/* first - get the length */
while (net_num < HDRSIZE)
{
-#ifndef _WIN32
+#ifndef OPENSSL_SYS_WIN32
i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
#else
i=_read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
@@ -173,7 +176,11 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
net_num=0;
while (net_num < rnum)
{
+#ifndef OPENSSL_SYS_WIN32
i=read(fd,(void *)&(net[net_num]),rnum-net_num);
+#else
+ i=_read(fd,(void *)&(net[net_num]),rnum-net_num);
+#endif
#ifdef EINTR
if ((i == -1) && (errno == EINTR)) continue;
#endif
@@ -228,5 +235,6 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
}
}
return num;
+#endif /* OPENSSL_NO_POSIX_IO */
}