summaryrefslogtreecommitdiffstats
path: root/lib/libevent/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libevent/buffer.c')
-rw-r--r--lib/libevent/buffer.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/libevent/buffer.c b/lib/libevent/buffer.c
index 71e9fb54584..783fd93a0a2 100644
--- a/lib/libevent/buffer.c
+++ b/lib/libevent/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.19 2010/07/17 17:16:47 chl Exp $ */
+/* $OpenBSD: buffer.c,v 1.20 2014/10/08 20:14:19 bluhm Exp $ */
/*
* Copyright (c) 2002, 2003 Niels Provos <provos@citi.umich.edu>
@@ -31,11 +31,6 @@
#include "config.h"
#endif
-#ifdef WIN32
-#include <winsock2.h>
-#include <windows.h>
-#endif
-
#ifdef HAVE_VASPRINTF
/* If we have vasprintf, we need to define this before we include stdio.h. */
#define _GNU_SOURCE
@@ -442,12 +437,7 @@ evbuffer_read(struct evbuffer *buf, int fd, int howmuch)
int n = EVBUFFER_MAX_READ;
#if defined(FIONREAD)
-#ifdef WIN32
- long lng = n;
- if (ioctlsocket(fd, FIONREAD, &lng) == -1 || (n=lng) <= 0) {
-#else
if (ioctl(fd, FIONREAD, &n) == -1 || n <= 0) {
-#endif
n = EVBUFFER_MAX_READ;
} else if (n > EVBUFFER_MAX_READ && n > howmuch) {
/*
@@ -473,11 +463,7 @@ evbuffer_read(struct evbuffer *buf, int fd, int howmuch)
/* We can append new data at this point */
p = buf->buffer + buf->off;
-#ifndef WIN32
n = read(fd, p, howmuch);
-#else
- n = recv(fd, p, howmuch, 0);
-#endif
if (n == -1)
return (-1);
if (n == 0)
@@ -497,11 +483,7 @@ evbuffer_write(struct evbuffer *buffer, int fd)
{
int n;
-#ifndef WIN32
n = write(fd, buffer->buffer, buffer->off);
-#else
- n = send(fd, buffer->buffer, buffer->off, 0);
-#endif
if (n == -1)
return (-1);
if (n == 0)