* fhandler.h (fhandler_base::issymlink): New method.

* syscalls.cc (open): Handle O_NOFOLLOW flag.
	* include/fcntl.h (_FNOFOLLOW): New define.
	(O_NOFOLLOW): Ditto.
	* include/cygwin/version.h: Bump API minor number.
This commit is contained in:
Corinna Vinschen
2005-12-22 16:45:15 +00:00
parent db55f91dc0
commit 52792a770d
5 changed files with 21 additions and 2 deletions

View File

@ -597,8 +597,15 @@ open (const char *unix_path, int flags, ...)
if (fd >= 0)
{
if (!(fh = build_fh_name (unix_path, NULL, PC_SYM_FOLLOW)))
if (!(fh = build_fh_name (unix_path, NULL, (flags & O_NOFOLLOW) ?
PC_SYM_NOFOLLOW : PC_SYM_FOLLOW)))
res = -1; // errno already set
else if ((flags & O_NOFOLLOW) && fh->issymlink ())
{
delete fh;
res = -1;
set_errno (ELOOP);
}
else if (((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) && fh->exists ())
{
delete fh;