S_ISLNK

Started by Nicholas Whiteabout 13 years ago3 messages
#1Nicholas White
n.j.white@gmail.com
1 attachment(s)

Hi - I'm cross-compiling the master branch (cygwin/mingw) and have found a
reference to S_ISLNK that isn't guarded by #ifndef WIN32 like the ones in
basebackup.c are. Could you merge the attached fix? Thanks -

Nick

Attachments:

exec-symlink-ifdef.patchapplication/octet-stream; name=exec-symlink-ifdef.patchDownload
*** a/src/port/exec.c
--- b/src/port/exec.c
***************
*** 263,269 **** resolve_symlinks(char *path)
--- 263,273 ----
  			fname = path;
  
  		if (lstat(fname, &buf) < 0 ||
+ #ifndef WIN32
  			!S_ISLNK(buf.st_mode))
+ #else
+ 			!pgwin32_is_junction(fname))
+ #endif					
  			break;
  
  		rllen = readlink(fname, link_buf, sizeof(link_buf));
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Nicholas White (#1)
Re: S_ISLNK

Nicholas White <n.j.white@gmail.com> writes:

Hi - I'm cross-compiling the master branch (cygwin/mingw) and have found a
reference to S_ISLNK that isn't guarded by #ifndef WIN32 like the ones in
basebackup.c are.

That whole function is guarded by HAVE_READLINK, so I'm not seeing the
problem (and neither are the Windows members of the buildfarm). What
environment are you in that has readlink() and not S_ISLNK?

regards, tom lane

#3Nicholas White
n.j.white@gmail.com
In reply to: Tom Lane (#2)
Re: S_ISLNK

Ah - OK. It turns out I'd run ./configure in the postgresql directory
before running it in my build directory, so I had two (different)
pg_config.hs! The below builds for me from a clean source tree now.
Thanks -

Nick

./path/to/build/configure CC=x86_64-w64-mingw32-gcc
--target=x86_64-w64-mingw32 --build=x86_64-w64-mingw32
--host=x86_64-w64-mingw32 --without-readline --without-zlib
--disable-thread-safety

Show quoted text

On 14 November 2012 06:25, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Nicholas White <n.j.white@gmail.com> writes:

Hi - I'm cross-compiling the master branch (cygwin/mingw) and have found a
reference to S_ISLNK that isn't guarded by #ifndef WIN32 like the ones in
basebackup.c are.

That whole function is guarded by HAVE_READLINK, so I'm not seeing the
problem (and neither are the Windows members of the buildfarm). What
environment are you in that has readlink() and not S_ISLNK?

regards, tom lane