diff options
Diffstat (limited to 'ghc/lib/std/cbits/filePutc.c')
-rw-r--r-- | ghc/lib/std/cbits/filePutc.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ghc/lib/std/cbits/filePutc.c b/ghc/lib/std/cbits/filePutc.c index 6c0e999c9f..e6234eea01 100644 --- a/ghc/lib/std/cbits/filePutc.c +++ b/ghc/lib/std/cbits/filePutc.c @@ -1,7 +1,7 @@ /* * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998 * - * $Id: filePutc.c,v 1.4 1999/01/12 10:53:02 sewardj Exp $ + * $Id: filePutc.c,v 1.5 1999/05/05 10:33:15 sof Exp $ * * hPutChar Runtime Support */ @@ -10,6 +10,10 @@ #include "stgio.h" #include "error.h" +#ifdef HAVE_WINSOCK_H +#include <winsock.h> +#endif + #define TERMINATE_LINE(x) ((x) == '\n') StgInt @@ -74,8 +78,14 @@ StgChar c; return FILEOBJ_BLOCKED_WRITE; /* Unbuffered, write the character directly. */ - while ((rc = write(fo->fd, &c, 1)) == 0 && errno == EINTR) ; - + while ((rc = ( +#ifdef HAVE_WINSOCK_H + fo->flags & FILEOBJ_WINSOCK ? + send(fo->fd, &c, 1, 0) : + write(fo->fd, &c, 1))) == 0 && errno == EINTR) ; +#else + write(fo->fd, &c, 1))) == 0 && errno == EINTR) ; +#endif if (rc == 0) { cvtErrno(); stdErrno(); |