From 973f782d33cb0b9fa6caf5487ca8916838d12556 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 6 Apr 2011 19:05:49 +0300 Subject: [PATCH] Don't call gnulib's careadlinkat on Windows. src/w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs. lib/makefile.w32-in ($(BLD)/careadlinkat.$(O), GNULIBOBJS): Revert last change. --- ChangeLog | 5 +++++ lib/makefile.w32-in | 15 ++------------- src/ChangeLog | 4 ++++ src/w32.c | 25 +++++++++++++++++++++++-- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c57bcabef41..b7f8f77dd34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-04-06 Eli Zaretskii + + * lib/makefile.w32-in ($(BLD)/careadlinkat.$(O), GNULIBOBJS): + Revert last change. + 2011-04-06 Juanma Barranquero * lib/makefile.w32-in (GNULIBOBJS): Add careadlinkat.$(O). diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index 895cd0b8369..b2aececf251 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in @@ -29,8 +29,7 @@ GNULIBOBJS = $(BLD)/dtoastr.$(O) \ $(BLD)/strftime.$(O) \ $(BLD)/time_r.$(O) \ $(BLD)/md5.$(O) \ - $(BLD)/filemode.$(O) \ - $(BLD)/careadlinkat.$(O) + $(BLD)/filemode.$(O) # # Build the library @@ -119,22 +118,12 @@ $(BLD)/filemode.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h -$(BLD)/careadlinkat.$(O) : \ - $(SRC)/careadlinkat.c \ - $(SRC)/careadlinkat.h \ - $(SRC)/allocator.h \ - $(EMACS_ROOT)/nt/inc/unistd.h \ - $(EMACS_ROOT)/nt/inc/sys/stat.h \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h - # The following dependencies are for supporting parallel builds, where # we must make sure $(BLD) exists before any compilation starts. # $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD -$(BLD)/filemode.$(O) $(BLD)/careadlinkat.$(O): stamp_BLD +$(BLD)/filemode.$(O): stamp_BLD # # Headers we would preprocess if we could. diff --git a/src/ChangeLog b/src/ChangeLog index 4c852723595..240fd8fb9a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-04-06 Eli Zaretskii + + * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs. + 2011-04-06 Paul Eggert Fix more problems found by GCC 4.6.0's static checks. diff --git a/src/w32.c b/src/w32.c index da403671115..d715c39fa81 100644 --- a/src/w32.c +++ b/src/w32.c @@ -138,6 +138,9 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX { #include "dispextern.h" /* for xstrcasecmp */ #include "coding.h" /* for Vlocale_coding_system */ +#include "careadlinkat.h" +#include "allocator.h" + /* For serial_configure and serial_open. */ #include "process.h" @@ -3610,8 +3613,8 @@ utime (const char *name, struct utimbuf *times) } -/* Symlink-related functions that always fail. Used in fileio.c to - avoid #ifdef's. */ +/* Symlink-related functions that always fail. Used in fileio.c and in + sysdep.c to avoid #ifdef's. */ int symlink (char const *dummy1, char const *dummy2) { @@ -3628,6 +3631,24 @@ readlink (const char *name, char *dummy1, size_t dummy2) return -1; } +char * +careadlinkat (int fd, char const *filename, + char *buffer, size_t buffer_size, + struct allocator const *alloc, + ssize_t (*preadlinkat) (int, char const *, char *, size_t)) +{ + errno = ENOSYS; + return NULL; +} + +ssize_t +careadlinkatcwd (int fd, char const *filename, char *buffer, + size_t buffer_size) +{ + (void) fd; + return readlink (filename, buffer, buffer_size); +} + /* Support for browsing other processes and their attributes. See process.c for the Lisp bindings. */ -- 2.39.2