From 58e7f038f9fddd4744279334d16380bb3a72416d Mon Sep 17 00:00:00 2001 From: djm Date: Sun, 18 Feb 2001 01:30:55 +0000 Subject: [PATCH 1/1] - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen and myself. --- ChangeLog | 2 ++ Makefile.in | 2 +- openbsd-compat/bsd-cygwin_util.c | 15 ++++++++++++++- openbsd-compat/bsd-cygwin_util.h | 5 ++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e1ba9285..aadacf2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ - (Bal) Patch for lack of RA_RESTART in misc.c for mysignal by stevesk + - (djm) Fix my breaking of cygwin builds, Patch from Corinna Vinschen + and myself. 20010217 - (bal) OpenBSD Sync: diff --git a/Makefile.in b/Makefile.in index 174ee1ac..8ca00299 100644 --- a/Makefile.in +++ b/Makefile.in @@ -26,7 +26,7 @@ PATHS= -DETCDIR=\"$(sysconfdir)\" \ CC=@CC@ LD=@LD@ CFLAGS=@CFLAGS@ -CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/openbsd-compat -I$(srcdir) $(PATHS) @DEFS@ +CPPFLAGS=@CPPFLAGS@ -I$(srcdir)/openbsd-compat $(PATHS) @DEFS@ LIBS=@LIBS@ AR=@AR@ RANLIB=@RANLIB@ diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 79ea907d..3d8696d1 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c @@ -26,8 +26,21 @@ RCSID("$Id$"); #include #define is_winnt (GetVersion() < 0x80000000) -int binary_open(const char *filename, int flags, mode_t mode) +#if defined(open) && open == binary_open +# undef open +#endif +#if defined(pipe) && open == binary_pipe +# undef pipe +#endif + +int binary_open(const char *filename, int flags, ...) { + va_list ap; + mode_t mode; + + va_start(ap, flags); + mode = va_arg(ap, mode_t); + va_end(ap); return open(filename, flags | O_BINARY, mode); } diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h index 0a9f44db..9a038519 100644 --- a/openbsd-compat/bsd-cygwin_util.h +++ b/openbsd-compat/bsd-cygwin_util.h @@ -15,7 +15,8 @@ /* $Id$ */ -#include "config.h" +#ifndef _BSD_CYGWIN_UTIL_H +#define _BSD_CYGWIN_UTIL_H #ifdef HAVE_CYGWIN @@ -28,3 +29,5 @@ int check_ntsec(const char *filename); #define pipe binary_pipe #endif /* HAVE_CYGWIN */ + +#endif /* _BSD_CYGWIN_UTIL_H */ -- 2.45.2