From: erg Date: Fri, 4 May 2007 18:38:09 +0000 (+0000) Subject: Fix sfio to build on Windows. X-Git-Tag: LAST_LIBGRAPH~32^2~5585 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9e9d10bc9d3b7ab22c4fbb6c4fceb45ca04f718;p=graphviz Fix sfio to build on Windows. --- diff --git a/lib/sfio/sfmode.c b/lib/sfio/sfmode.c index bd6faf4f0..c5a5dfcc8 100644 --- a/lib/sfio/sfmode.c +++ b/lib/sfio/sfmode.c @@ -263,8 +263,10 @@ reg Sfio_t *f; /* stream to close */ #if _PACKAGE_ast sigcritical(1); #endif +#ifndef WIN32 while ((pid = waitpid(p->pid, &status, 0)) == -1 && errno == EINTR); +#endif if (pid < 0) status = -1; #if _PACKAGE_ast diff --git a/lib/sfio/sfopen.c b/lib/sfio/sfopen.c index ab37b0e08..636c0a48d 100644 --- a/lib/sfio/sfopen.c +++ b/lib/sfio/sfopen.c @@ -15,6 +15,9 @@ **********************************************************/ #include "sfhdr.h" +#ifdef WIN32 +#include "io.h" +#endif /* Open a file/string for IO. ** If f is not nil, it is taken as an existing stream that should be @@ -39,6 +42,8 @@ reg char *mode; /* mode of the stream */ return NIL(Sfio_t *); /* usually used on the standard streams to change control flags */ + +#ifndef WIN32 if (f && !file && (f->mode & SF_INIT)) { SFMTXSTART(f, NIL(Sfio_t *)); @@ -48,7 +53,6 @@ reg char *mode; /* mode of the stream */ ctl = (ctl & ~(O_TEXT | O_BINARY | O_APPEND)) | oflags; fcntl(f->file, F_SETFL, ctl); } - /* set all non read-write flags */ f->flags |= (sflags & (SF_FLAGS & ~SF_RDWR)); @@ -72,6 +76,7 @@ reg char *mode; /* mode of the stream */ SFMTXRETURN(f, NIL(Sfio_t *)); } +#endif if (sflags & SF_STRING) { f = sfnew(f, (char *) file, file ? (size_t) strlen((char *) file) : (size_t)