aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2012-06-23 13:22:59 +0300
committerEli Zaretskii2012-06-23 13:22:59 +0300
commit388cdec072a52e1b647dec159433fd0ffe240be4 (patch)
treeefd6a04f97a631114fd093b4414a9242486e04a5
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
-rw-r--r--ChangeLog15
-rw-r--r--lib/makefile.w32-in39
-rw-r--r--lib/stat-time.h1
-rw-r--r--lib/timespec.h1
-rw-r--r--lib/utimens.h1
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/inc/sys/time.h23
-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
12 files changed, 126 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 21072dd6a79..103af723a34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
12012-06-23 Eli Zaretskii <eliz@gnu.org>
2
3 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4 * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/dtotimespec.$(O),
5 $(BLD)/gettime.$(O), $(BLD)/timespec-add.$(O), and
6 $(BLD)/timespec-sub.$(O).
7 ($(BLD)/dtotimespec.$(O)):
8 ($(BLD)/gettime.$(O)):
9 ($(BLD)/timespec-add.$(O)):
10 ($(BLD)/timespec-sub.$(O)): New dependencies.
11
12 * lib/stat-time.h:
13 * lib/timespec.h:
14 * lib/utimens.h: Include sys/time.h
15
12012-06-23 Andreas Schwab <schwab@linux-m68k.org> 162012-06-23 Andreas Schwab <schwab@linux-m68k.org>
2 17
3 * configure.in: Don't use AC_CHECK_FUNCS_ONCE, which doesn't use 18 * configure.in: Don't use AC_CHECK_FUNCS_ONCE, which doesn't use
diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in
index 62808f73a74..35745f647b2 100644
--- a/lib/makefile.w32-in
+++ b/lib/makefile.w32-in
@@ -24,10 +24,14 @@ LOCAL_FLAGS = -DHAVE_CONFIG_H=1 -I. -I../nt/inc -I../src
24LIBS = 24LIBS =
25 25
26GNULIBOBJS = $(BLD)/dtoastr.$(O) \ 26GNULIBOBJS = $(BLD)/dtoastr.$(O) \
27 $(BLD)/dtotimespec.$(O) \
27 $(BLD)/getopt.$(O) \ 28 $(BLD)/getopt.$(O) \
28 $(BLD)/getopt1.$(O) \ 29 $(BLD)/getopt1.$(O) \
30 $(BLD)/gettime.$(O) \
29 $(BLD)/strftime.$(O) \ 31 $(BLD)/strftime.$(O) \
30 $(BLD)/time_r.$(O) \ 32 $(BLD)/time_r.$(O) \
33 $(BLD)/timespec-add.$(O) \
34 $(BLD)/timespec-sub.$(O) \
31 $(BLD)/md5.$(O) \ 35 $(BLD)/md5.$(O) \
32 $(BLD)/sha1.$(O) \ 36 $(BLD)/sha1.$(O) \
33 $(BLD)/sha256.$(O) \ 37 $(BLD)/sha256.$(O) \
@@ -69,6 +73,15 @@ $(BLD)/dtoastr.$(O) : \
69 $(EMACS_ROOT)/src/s/ms-w32.h \ 73 $(EMACS_ROOT)/src/s/ms-w32.h \
70 $(EMACS_ROOT)/src/config.h 74 $(EMACS_ROOT)/src/config.h
71 75
76$(BLD)/dtotimespec.$(O) : \
77 $(SRC)/dtotimespec.c \
78 $(SRC)/intprops.h \
79 $(SRC)/timespec.h \
80 $(EMACS_ROOT)/nt/inc/sys/time.h \
81 $(EMACS_ROOT)/nt/inc/sys/stat.h \
82 $(EMACS_ROOT)/src/s/ms-w32.h \
83 $(EMACS_ROOT)/src/config.h
84
72$(BLD)/getopt.$(O) : \ 85$(BLD)/getopt.$(O) : \
73 $(SRC)/getopt.c \ 86 $(SRC)/getopt.c \
74 $(SRC)/getopt.h \ 87 $(SRC)/getopt.h \
@@ -87,6 +100,14 @@ $(BLD)/getopt1.$(O) : \
87 $(EMACS_ROOT)/src/s/ms-w32.h \ 100 $(EMACS_ROOT)/src/s/ms-w32.h \
88 $(EMACS_ROOT)/src/config.h 101 $(EMACS_ROOT)/src/config.h
89 102
103$(BLD)/gettime.$(O) : \
104 $(SRC)/gettime.c \
105 $(SRC)/timespec.h \
106 $(EMACS_ROOT)/nt/inc/sys/time.h \
107 $(EMACS_ROOT)/nt/inc/sys/stat.h \
108 $(EMACS_ROOT)/src/s/ms-w32.h \
109 $(EMACS_ROOT)/src/config.h
110
90$(BLD)/strftime.$(O) : \ 111$(BLD)/strftime.$(O) : \
91 $(SRC)/strftime.c \ 112 $(SRC)/strftime.c \
92 $(SRC)/strftime.h \ 113 $(SRC)/strftime.h \
@@ -101,6 +122,24 @@ $(BLD)/time_r.$(O) : \
101 $(EMACS_ROOT)/src/s/ms-w32.h \ 122 $(EMACS_ROOT)/src/s/ms-w32.h \
102 $(EMACS_ROOT)/src/config.h 123 $(EMACS_ROOT)/src/config.h
103 124
125$(BLD)/timespec-add.$(O) : \
126 $(SRC)/timespec-add.c \
127 $(SRC)/intprops.h \
128 $(SRC)/timespec.h \
129 $(EMACS_ROOT)/nt/inc/sys/time.h \
130 $(EMACS_ROOT)/nt/inc/sys/stat.h \
131 $(EMACS_ROOT)/src/s/ms-w32.h \
132 $(EMACS_ROOT)/src/config.h
133
134$(BLD)/timespec-sub.$(O) : \
135 $(SRC)/timespec-sub.c \
136 $(SRC)/intprops.h \
137 $(SRC)/timespec.h \
138 $(EMACS_ROOT)/nt/inc/sys/time.h \
139 $(EMACS_ROOT)/nt/inc/sys/stat.h \
140 $(EMACS_ROOT)/src/s/ms-w32.h \
141 $(EMACS_ROOT)/src/config.h
142
104$(BLD)/md5.$(O) : \ 143$(BLD)/md5.$(O) : \
105 $(SRC)/md5.c \ 144 $(SRC)/md5.c \
106 $(SRC)/md5.h \ 145 $(SRC)/md5.h \
diff --git a/lib/stat-time.h b/lib/stat-time.h
index 30c2acdab63..03d49977945 100644
--- a/lib/stat-time.h
+++ b/lib/stat-time.h
@@ -22,6 +22,7 @@
22 22
23#include <sys/stat.h> 23#include <sys/stat.h>
24#include <time.h> 24#include <time.h>
25#include <sys/time.h>
25 26
26/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type 27/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
27 struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, 28 struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,
diff --git a/lib/timespec.h b/lib/timespec.h
index 388ddb83a76..51b85d050da 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -20,6 +20,7 @@
20# define TIMESPEC_H 20# define TIMESPEC_H
21 21
22# include <time.h> 22# include <time.h>
23# include <sys/time.h>
23 24
24/* Return negative, zero, positive if A < B, A == B, A > B, respectively. 25/* Return negative, zero, positive if A < B, A == B, A > B, respectively.
25 26
diff --git a/lib/utimens.h b/lib/utimens.h
index 8c47cf93f88..dfcbae1909d 100644
--- a/lib/utimens.h
+++ b/lib/utimens.h
@@ -1,4 +1,5 @@
1#include <time.h> 1#include <time.h>
2#include <sys/time.h>
2int fdutimens (int, char const *, struct timespec const [2]); 3int fdutimens (int, char const *, struct timespec const [2]);
3int utimens (char const *, struct timespec const [2]); 4int utimens (char const *, struct timespec const [2]);
4int lutimens (char const *, struct timespec const [2]); 5int lutimens (char const *, struct timespec const [2]);
diff --git a/nt/ChangeLog b/nt/ChangeLog
index cc5fda97755..11109da92f2 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12012-06-23 Eli Zaretskii <eliz@gnu.org>
2
3 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4 * inc/sys/time.h (struct timespec): Define.
5
12012-06-16 Eli Zaretskii <eliz@gnu.org> 62012-06-16 Eli Zaretskii <eliz@gnu.org>
2 7
3 * makefile.w32-in (install-addpm): New target. 8 * makefile.w32-in (install-addpm): New target.
diff --git a/nt/inc/sys/time.h b/nt/inc/sys/time.h
index c90d1fd62f5..583b966b760 100644
--- a/nt/inc/sys/time.h
+++ b/nt/inc/sys/time.h
@@ -6,15 +6,22 @@
6 */ 6 */
7 7
8struct timeval 8struct timeval
9 { 9{
10 long tv_sec; /* seconds */ 10 long tv_sec; /* seconds */
11 long tv_usec; /* microseconds */ 11 long tv_usec; /* microseconds */
12 }; 12};
13
13struct timezone 14struct timezone
14 { 15{
15 int tz_minuteswest; /* minutes west of Greenwich */ 16 int tz_minuteswest; /* minutes west of Greenwich */
16 int tz_dsttime; /* type of dst correction */ 17 int tz_dsttime; /* type of dst correction */
17 }; 18};
19
20struct timespec
21{
22 time_t tv_sec; /* seconds */
23 long int tv_nsec; /* nanoseconds */
24};
18 25
19void gettimeofday (struct timeval *, struct timezone *); 26void gettimeofday (struct timeval *, struct timezone *);
20 27
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)