1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-10 15:56:18 +00:00

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
This commit is contained in:
Eli Zaretskii 2012-06-23 13:22:59 +03:00
parent f199cab1a9
commit 388cdec072
12 changed files with 126 additions and 9 deletions

View File

@ -1,3 +1,18 @@
2012-06-23 Eli Zaretskii <eliz@gnu.org>
Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
* 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
2012-06-23 Andreas Schwab <schwab@linux-m68k.org>
* configure.in: Don't use AC_CHECK_FUNCS_ONCE, which doesn't use

View File

@ -24,10 +24,14 @@ LOCAL_FLAGS = -DHAVE_CONFIG_H=1 -I. -I../nt/inc -I../src
LIBS =
GNULIBOBJS = $(BLD)/dtoastr.$(O) \
$(BLD)/dtotimespec.$(O) \
$(BLD)/getopt.$(O) \
$(BLD)/getopt1.$(O) \
$(BLD)/gettime.$(O) \
$(BLD)/strftime.$(O) \
$(BLD)/time_r.$(O) \
$(BLD)/timespec-add.$(O) \
$(BLD)/timespec-sub.$(O) \
$(BLD)/md5.$(O) \
$(BLD)/sha1.$(O) \
$(BLD)/sha256.$(O) \
@ -69,6 +73,15 @@ $(BLD)/dtoastr.$(O) : \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/dtotimespec.$(O) : \
$(SRC)/dtotimespec.c \
$(SRC)/intprops.h \
$(SRC)/timespec.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(EMACS_ROOT)/nt/inc/sys/stat.h \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/getopt.$(O) : \
$(SRC)/getopt.c \
$(SRC)/getopt.h \
@ -87,6 +100,14 @@ $(BLD)/getopt1.$(O) : \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/gettime.$(O) : \
$(SRC)/gettime.c \
$(SRC)/timespec.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(EMACS_ROOT)/nt/inc/sys/stat.h \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/strftime.$(O) : \
$(SRC)/strftime.c \
$(SRC)/strftime.h \
@ -101,6 +122,24 @@ $(BLD)/time_r.$(O) : \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/timespec-add.$(O) : \
$(SRC)/timespec-add.c \
$(SRC)/intprops.h \
$(SRC)/timespec.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(EMACS_ROOT)/nt/inc/sys/stat.h \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/timespec-sub.$(O) : \
$(SRC)/timespec-sub.c \
$(SRC)/intprops.h \
$(SRC)/timespec.h \
$(EMACS_ROOT)/nt/inc/sys/time.h \
$(EMACS_ROOT)/nt/inc/sys/stat.h \
$(EMACS_ROOT)/src/s/ms-w32.h \
$(EMACS_ROOT)/src/config.h
$(BLD)/md5.$(O) : \
$(SRC)/md5.c \
$(SRC)/md5.h \

View File

@ -22,6 +22,7 @@
#include <sys/stat.h>
#include <time.h>
#include <sys/time.h>
/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST,

View File

@ -20,6 +20,7 @@
# define TIMESPEC_H
# include <time.h>
# include <sys/time.h>
/* Return negative, zero, positive if A < B, A == B, A > B, respectively.

View File

@ -1,4 +1,5 @@
#include <time.h>
#include <sys/time.h>
int fdutimens (int, char const *, struct timespec const [2]);
int utimens (char const *, struct timespec const [2]);
int lutimens (char const *, struct timespec const [2]);

View File

@ -1,3 +1,8 @@
2012-06-23 Eli Zaretskii <eliz@gnu.org>
Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
* inc/sys/time.h (struct timespec): Define.
2012-06-16 Eli Zaretskii <eliz@gnu.org>
* makefile.w32-in (install-addpm): New target.

View File

@ -6,15 +6,22 @@
*/
struct timeval
{
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
{
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
struct timezone
{
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};
{
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};
struct timespec
{
time_t tv_sec; /* seconds */
long int tv_nsec; /* nanoseconds */
};
void gettimeofday (struct timeval *, struct timezone *);

View File

@ -1,5 +1,14 @@
2012-06-23 Eli Zaretskii <eliz@gnu.org>
Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
* w32.c (fdutimens): New function.
* w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
* s/ms-w32.h (pselect): Redirect to sys_select.
* sysselect.h [WINDOWSNT]: Don't include sys/select.h.
* ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
in the logic of incrementing and decrementing the value of
use_relocatable_buffers.

View File

@ -226,6 +226,7 @@ struct sigaction {
#define rename sys_rename
#define rmdir sys_rmdir
#define select sys_select
#define pselect sys_select
#define sleep sys_sleep
#define strerror sys_strerror
#undef unlink

View File

@ -19,7 +19,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#if defined (DARWIN_OS)
#undef init_process
#endif
#ifndef WINDOWSNT
#include <sys/select.h>
#endif
#if defined (DARWIN_OS)
#define init_process emacs_init_process
#endif

View File

@ -1996,6 +1996,41 @@ gettimeofday (struct timeval *tv, struct timezone *tz)
}
}
/* Emulate fdutimens. */
/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
TIMESPEC[0] and TIMESPEC[1], respectively.
FD must be either negative -- in which case it is ignored --
or a file descriptor that is open on FILE.
If FD is nonnegative, then FILE can be NULL, which means
use just futimes instead of utimes.
If TIMESPEC is null, FAIL.
Return 0 on success, -1 (setting errno) on failure. */
int
fdutimens (int fd, char const *file, struct timespec const timespec[2])
{
struct _utimbuf ut;
if (!timespec)
{
errno = ENOSYS;
return -1;
}
if (fd < 0 && !file)
{
errno = EBADF;
return -1;
}
ut.actime = timespec[0].tv_sec;
ut.modtime = timespec[1].tv_sec;
if (fd >= 0)
return _futime (fd, &ut);
else
return _utime (file, &ut);
}
/* ------------------------------------------------------------------------- */
/* IO support and wrapper functions for W32 API. */
/* ------------------------------------------------------------------------- */

View File

@ -1090,7 +1090,8 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
HANDLE wait_hnd[MAXDESC + MAX_CHILDREN];
int fdindex[MAXDESC]; /* mapping from wait handles back to descriptors */
timeout_ms = timeout ? (timeout->tv_sec * 1000 + timeout->tv_usec / 1000) : INFINITE;
timeout_ms =
timeout ? (timeout->tv_sec * 1000 + timeout->tv_nsec / 1000000) : INFINITE;
/* If the descriptor sets are NULL but timeout isn't, then just Sleep. */
if (rfds == NULL && wfds == NULL && efds == NULL && timeout != NULL)