mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 06:16:10 -04:00
test/regress_ssl: Fix compile problems for win32
Windows doesn't have unistd.h, but have the required functionality in io.h. azat: use ev_ssize_t instead of ssize_t
This commit is contained in:
parent
96f64a0220
commit
73d0360e83
@ -56,7 +56,13 @@
|
|||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <io.h>
|
||||||
|
#define read _read
|
||||||
|
#define write _write
|
||||||
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* A short pre-generated key, to save the cost of doing an RSA key generation
|
/* A short pre-generated key, to save the cost of doing an RSA key generation
|
||||||
* step during the unit tests. It's only 512 bits long, and it is published
|
* step during the unit tests. It's only 512 bits long, and it is published
|
||||||
@ -549,7 +555,7 @@ static int
|
|||||||
bio_rwcount_read(BIO *b, char *out, int outlen)
|
bio_rwcount_read(BIO *b, char *out, int outlen)
|
||||||
{
|
{
|
||||||
struct rwcount *rw = b->ptr;
|
struct rwcount *rw = b->ptr;
|
||||||
ssize_t ret = read(rw->fd, out, outlen);
|
ev_ssize_t ret = read(rw->fd, out, outlen);
|
||||||
++rw->read;
|
++rw->read;
|
||||||
if (ret == -1 && errno == EAGAIN) {
|
if (ret == -1 && errno == EAGAIN) {
|
||||||
BIO_set_retry_read(b);
|
BIO_set_retry_read(b);
|
||||||
@ -561,7 +567,7 @@ bio_rwcount_write(BIO *b, const char *in, int inlen)
|
|||||||
{
|
{
|
||||||
|
|
||||||
struct rwcount *rw = b->ptr;
|
struct rwcount *rw = b->ptr;
|
||||||
ssize_t ret = write(rw->fd, in, inlen);
|
ev_ssize_t ret = write(rw->fd, in, inlen);
|
||||||
++rw->write;
|
++rw->write;
|
||||||
if (ret == -1 && errno == EAGAIN) {
|
if (ret == -1 && errno == EAGAIN) {
|
||||||
BIO_set_retry_write(b);
|
BIO_set_retry_write(b);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user