From 1d44267275efdcee3c3584eaa79baccad54266b3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 7 Jul 2013 21:48:16 +0300 Subject: MS-Windows followup for 2013-07-07T18:00:14Z!eggert@cs.ucla.edu. nt/inc/sys/socket.h (F_SETFD, O_CLOEXEC, F_DUPFD_CLOEXEC) (FD_CLOEXEC): New macros. src/w32.c (sys_dup): Declare prototype. src/filelock.c: src/emacs.c: src/callproc.c [WINDOWSNT]: Include sys/socket.h. --- nt/ChangeLog | 5 +++++ nt/inc/sys/socket.h | 4 ++++ src/ChangeLog | 8 ++++++++ src/callproc.c | 1 + src/emacs.c | 1 + src/filelock.c | 1 + src/w32.c | 2 ++ 7 files changed, 22 insertions(+) diff --git a/nt/ChangeLog b/nt/ChangeLog index a9b4f83664..c0598dd563 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,8 @@ +2013-07-07 Eli Zaretskii + + * inc/sys/socket.h (F_SETFD, O_CLOEXEC, F_DUPFD_CLOEXEC) + (FD_CLOEXEC): New macros. + 2013-07-07 Paul Eggert Make file descriptors close-on-exec when possible (Bug#14803). diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h index 99227d75d2..93bf9f9166 100644 --- a/nt/inc/sys/socket.h +++ b/nt/inc/sys/socket.h @@ -123,7 +123,11 @@ int sys_sendto (int s, const char * buf, int len, int flags, an fcntl function, for setting sockets to non-blocking mode. */ int fcntl (int s, int cmd, int options); #define F_SETFL 4 +#define F_SETFD 2 #define O_NONBLOCK 04000 +#define O_CLOEXEC O_NOINHERIT +#define F_DUPFD_CLOEXEC 0x40000000 +#define FD_CLOEXEC 1 /* we are providing a real h_errno variable */ #undef h_errno diff --git a/src/ChangeLog b/src/ChangeLog index 07285d564b..9eb7b5b862 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2013-07-07 Eli Zaretskii + + * w32.c (sys_dup): Declare prototype. + + * filelock.c: + * emacs.c: + * callproc.c [WINDOWSNT]: Include sys/socket.h. + 2013-07-07 Paul Eggert Make file descriptors close-on-exec when possible (Bug#14803). diff --git a/src/callproc.c b/src/callproc.c index 3e70b1c2e4..369d6eda90 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -31,6 +31,7 @@ along with GNU Emacs. If not, see . */ #ifdef WINDOWSNT #define NOMINMAX +#include /* for fcntl */ #include #include "w32.h" #define _P_NOWAIT 1 /* from process.h */ diff --git a/src/emacs.c b/src/emacs.c index e4412e2ea1..edf98d8cdb 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -34,6 +34,7 @@ along with GNU Emacs. If not, see . */ #ifdef WINDOWSNT #include +#include #include "w32.h" #include "w32heap.h" #endif diff --git a/src/filelock.c b/src/filelock.c index 1fcd243248..6e939f271d 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -47,6 +47,7 @@ along with GNU Emacs. If not, see . */ #include "systime.h" #ifdef WINDOWSNT #include +#include /* for fcntl */ #include "w32.h" /* for dostounix_filename */ #endif diff --git a/src/w32.c b/src/w32.c index 46aebe8b63..1a3d81bbff 100644 --- a/src/w32.c +++ b/src/w32.c @@ -234,6 +234,8 @@ extern int sys_access (const char *, int); extern void *e_malloc (size_t); extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, EMACS_TIME *, void *); +extern int sys_dup (int); + -- cgit v1.2.3