From cf1fd675d2fb05c46ea472bbb3266985b63fbf01 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 13 Nov 2007 16:57:47 +0100 Subject: [PATCH] Implement a stub for fcntl(). This stub does nothing for F_GETFD and F_SETFD, and fails for all other commands. Signed-off-by: Johannes Sixt --- git-compat-util.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index bfdee76749..85b5d8806a 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -563,6 +563,13 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out); sig_handler_t mingw_signal(int sig, sig_handler_t handler); #define signal mingw_signal +#define F_GETFD 1 +#define F_SETFD 2 +#define FD_CLOEXEC 0x1 +static inline int mingw_fcntl(int fd, int cmd, long arg) +{ return cmd == F_GETFD || cmd == F_SETFD ? 0 : (errno = EINVAL, -1); } +#define fcntl mingw_fcntl + #endif /* __MINGW32__ */ #endif