From 99138976d9f0e9f94e9920af5e61ace9fd5554df Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 24 Jul 2002 05:37:47 +0000 Subject: * path.cc (path_conv::check): Always set fileattr when component == 0. (readlink): Use path_conv method rather than field. * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto, throughout. * path.h (path_conv): Make fileattr private. * exceptions.cc (try_to_debug): Default to idle priority when looping. --- winsup/cygwin/path.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index c09b4591f..f4527afd8 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -447,7 +447,6 @@ path_conv::check (const char *src, unsigned opt, error = 0; else if ((error = check_null_empty_str (src))) return; - /* This loop handles symlink expansion. */ for (;;) { @@ -603,7 +602,10 @@ path_conv::check (const char *src, unsigned opt, if (!(opt & PC_SYM_IGNORE)) { if (!component) - path_flags = sym.pflags; + { + fileattr = sym.fileattr; + path_flags = sym.pflags; + } /* If symlink.check found an existing non-symlink file, then it sets the appropriate flag. It also sets any suffix found @@ -612,10 +614,7 @@ path_conv::check (const char *src, unsigned opt, { error = sym.error; if (component == 0) - { - fileattr = sym.fileattr; - add_ext_from_sym (sym); - } + add_ext_from_sym (sym); if (pcheck_case == PCHECK_RELAXED) goto out; // file found /* Avoid further symlink evaluation. Only case checks are @@ -633,7 +632,6 @@ path_conv::check (const char *src, unsigned opt, if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW)) { set_symlink (); // last component of path is a symlink. - fileattr = sym.fileattr; if (opt & PC_SYM_CONTENTS) { strcpy (path, sym.contents); @@ -3072,7 +3070,7 @@ readlink (const char *path, char *buf, int buflen) if (!pathbuf.issymlink ()) { - if (pathbuf.fileattr != INVALID_FILE_ATTRIBUTES) + if (pathbuf.exists ()) set_errno (EINVAL); return -1; } -- cgit v1.2.3