summaryrefslogtreecommitdiff
path: root/portable
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-04-07 03:48:19 +0000
committerRuss Allbery <rra@stanford.edu>2008-04-07 03:48:19 +0000
commit7a94327d9f9328c64cc7e8f7bc8527f07716ac23 (patch)
treeecfac0588615a1317c4d24e27b841e3591366440 /portable
parentb47f63abd8a5e2c4831dc2eb4047156155c3855f (diff)
Several Windows fixes from Matthew Loar, plus really include
portable/winsock.c in the distribution. This version should now build and run on Windows.
Diffstat (limited to 'portable')
-rw-r--r--portable/uio.h5
-rw-r--r--portable/winsock.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/portable/uio.h b/portable/uio.h
index 66b5353..70a8d07 100644
--- a/portable/uio.h
+++ b/portable/uio.h
@@ -15,9 +15,10 @@
#include <sys/types.h>
-#ifdef HAVE_SYS_UIO_H
+/* remctl.h provides its own definition of this struct on Windows. */
+#if defined(HAVE_SYS_UIO_H)
# include <sys/uio.h>
-#else
+#elif !defined(REMCTL_H)
struct iovec {
void *iov_base;
size_t iov_len;
diff --git a/portable/winsock.c b/portable/winsock.c
index 9c9a00b..1ebdd69 100644
--- a/portable/winsock.c
+++ b/portable/winsock.c
@@ -22,7 +22,7 @@
int
socket_init(void)
{
- WSADATA *data;
+ WSADATA data;
if (WSAStartup(MAKEWORD(2,2), &data))
return 0;
@@ -42,7 +42,8 @@ socket_strerror(err)
if (err >= sys_nerr) {
char *p;
- DWORD f = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM;
+ DWORD f = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS;
static char *buffer = NULL;
if (buffer != NULL)