From: Marko DOT Kohtala AT ntc DOT nokia DOT com (Kohtala Marko) Subject: Re: A patch for _opening com1 2 Apr 1997 02:52:17 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199704020809.LAA05206.cygnus.gnu-win32@axl01it.ntc.nokia.com> Reply-To: Marko DOT Kohtala AT ntc DOT nokia DOT com Original-To: dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de Original-Cc: gnu-win32 AT cygnus DOT com, dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de In-Reply-To: <009B22AE.98C2AA60.13237@ifk20.mach.uni-karlsruhe.de> (dahms AT ifk20 DOT mach DOT uni-karlsruhe DOT de) Original-Sender: owner-gnu-win32 AT cygnus DOT com > Hi Marko, you wrote: > : + if (GetFileType (h) != FILE_TYPE_DISK) > : + { > : + /* It is not a disk file, can not be a symlink */ > If I remember right, there's also FILE_TYPE_REMOTE, which also holds disk > files and possibly symlinks. You are right. This FILE_TYPE_REMOVE is a flag bit in the return value and the Win32 Programmer's Reference fails to tell so. I found it mentioned in machintosh porting reference and in the WINBASE.H header file though... So the patch should be like diff -up b17.1/winsup/path.cc\~ b17.1/winsup/path.cc --- b17.1/winsup/path.cc~ Wed Dec 4 05:23:01 1996 +++ b17.1/winsup/path.cc Tue Apr 1 17:14:21 1997 @@ -1056,7 +1056,14 @@ symlink_check (const char *path, char *b char cookie_buf[sizeof (SYMLINK_COOKIE) - 1]; DWORD done; - if (! ReadFile (h, cookie_buf, sizeof (cookie_buf), &done, 0)) + if ((GetFileType (h) & ~FILE_TYPE_REMOVE) != FILE_TYPE_DISK) + { + /* It is not a disk file, can not be a symlink */ + *syml = 0; + *exec = 0; + res = 0; + } + else if (! ReadFile (h, cookie_buf, sizeof (cookie_buf), &done, 0)) { set_errno (EIO); } -- --- Marko Kohtala - Marko DOT Kohtala AT ntc DOT nokia DOT com, Marko DOT Kohtala AT hut DOT fi - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".