aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-06-23 13:22:59 +0300
committerEli Zaretskii2012-06-23 13:22:59 +0300
commit388cdec072a52e1b647dec159433fd0ffe240be4 (patch)
treeefd6a04f97a631114fd093b4414a9242486e04a5 /src
parentf199cab1a97da8c46b719bb73af58acdcb6243c1 (diff)
downloademacs-388cdec072a52e1b647dec159433fd0ffe240be4.tar.gz
emacs-388cdec072a52e1b647dec159433fd0ffe240be4.zip
Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
nt/inc/sys/time.h (struct timespec): Define. lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/dtotimespec.$(O), $(BLD)/gettime.$(O), $(BLD)/timespec-add.$(O), and $(BLD)/timespec-sub.$(O). ($(BLD)/dtotimespec.$(O)): ($(BLD)/gettime.$(O)): ($(BLD)/timespec-add.$(O)): ($(BLD)/timespec-sub.$(O)): New dependencies. lib/stat-time.h: lib/timespec.h: lib/utimens.h: Include sys/time.h src/w32.c (fdutimens): New function. src/w32proc.c (sys_select): Adapt to change in the EMACS_TIME type. src/s/ms-w32.h (pselect): Redirect to sys_select. src/sysselect.h [WINDOWSNT]: Don't include sys/select.h. Fixes: debbugs:9000
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/s/ms-w32.h1
-rw-r--r--src/sysselect.h2
-rw-r--r--src/w32.c35
-rw-r--r--src/w32proc.c3
5 files changed, 49 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 557a844c8f1..27101506fa8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,14 @@
12012-06-23 Eli Zaretskii <eliz@gnu.org> 12012-06-23 Eli Zaretskii <eliz@gnu.org>
2 2
3 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4 * w32.c (fdutimens): New function.
5
6 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7
8 * s/ms-w32.h (pselect): Redirect to sys_select.
9
10 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11
3 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko 12 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4 in the logic of incrementing and decrementing the value of 13 in the logic of incrementing and decrementing the value of
5 use_relocatable_buffers. 14 use_relocatable_buffers.
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 5bf71d5f321..a26530bab64 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -226,6 +226,7 @@ struct sigaction {
226#define rename sys_rename 226#define rename sys_rename
227#define rmdir sys_rmdir 227#define rmdir sys_rmdir
228#define select sys_select 228#define select sys_select
229#define pselect sys_select
229#define sleep sys_sleep 230#define sleep sys_sleep
230#define strerror sys_strerror 231#define strerror sys_strerror
231#undef unlink 232#undef unlink
diff --git a/src/sysselect.h b/src/sysselect.h
index e1e5839cfe4..328372d427c 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -19,7 +19,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#if defined (DARWIN_OS) 19#if defined (DARWIN_OS)
20#undef init_process 20#undef init_process
21#endif 21#endif
22#ifndef WINDOWSNT
22#include <sys/select.h> 23#include <sys/select.h>
24#endif
23#if defined (DARWIN_OS) 25#if defined (DARWIN_OS)
24#define init_process emacs_init_process 26#define init_process emacs_init_process
25#endif 27#endif
diff --git a/src/w32.c b/src/w32.c
index dbe7ec1764f..5a36a43302e 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1996,6 +1996,41 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
1996 } 1996 }
1997} 1997}
1998 1998
1999/* Emulate fdutimens. */
2000
2001/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
2002 TIMESPEC[0] and TIMESPEC[1], respectively.
2003 FD must be either negative -- in which case it is ignored --
2004 or a file descriptor that is open on FILE.
2005 If FD is nonnegative, then FILE can be NULL, which means
2006 use just futimes instead of utimes.
2007 If TIMESPEC is null, FAIL.
2008 Return 0 on success, -1 (setting errno) on failure. */
2009
2010int
2011fdutimens (int fd, char const *file, struct timespec const timespec[2])
2012{
2013 struct _utimbuf ut;
2014
2015 if (!timespec)
2016 {
2017 errno = ENOSYS;
2018 return -1;
2019 }
2020 if (fd < 0 && !file)
2021 {
2022 errno = EBADF;
2023 return -1;
2024 }
2025 ut.actime = timespec[0].tv_sec;
2026 ut.modtime = timespec[1].tv_sec;
2027 if (fd >= 0)
2028 return _futime (fd, &ut);
2029 else
2030 return _utime (file, &ut);
2031}
2032
2033
1999/* ------------------------------------------------------------------------- */ 2034/* ------------------------------------------------------------------------- */
2000/* IO support and wrapper functions for W32 API. */ 2035/* IO support and wrapper functions for W32 API. */
2001/* ------------------------------------------------------------------------- */ 2036/* ------------------------------------------------------------------------- */
diff --git a/src/w32proc.c b/src/w32proc.c
index 5bdeba25958..55b9ee1ec0e 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1090,7 +1090,8 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
1090 HANDLE wait_hnd[MAXDESC + MAX_CHILDREN]; 1090 HANDLE wait_hnd[MAXDESC + MAX_CHILDREN];
1091 int fdindex[MAXDESC]; /* mapping from wait handles back to descriptors */ 1091 int fdindex[MAXDESC]; /* mapping from wait handles back to descriptors */
1092 1092
1093 timeout_ms = timeout ? (timeout->tv_sec * 1000 + timeout->tv_usec / 1000) : INFINITE; 1093 timeout_ms =
1094 timeout ? (timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000) : INFINITE;
1094 1095
1095 /* If the descriptor sets are NULL but timeout isn't, then just Sleep. */ 1096 /* If the descriptor sets are NULL but timeout isn't, then just Sleep. */
1096 if (rfds == NULL && wfds == NULL && efds == NULL && timeout != NULL) 1097 if (rfds == NULL && wfds == NULL && efds == NULL && timeout != NULL)