diff options
author | Christopher Faylor <me@cgf.cx> | 2002-07-24 05:37:47 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-07-24 05:37:47 +0000 |
commit | 99138976d9f0e9f94e9920af5e61ace9fd5554df (patch) | |
tree | 317a5dc50db8febc6e0cc603627c58f669b3c423 /winsup/cygwin/path.cc | |
parent | 63a93e9dd606b8760bf9bb26320978629c8f45a1 (diff) | |
download | cygnal-99138976d9f0e9f94e9920af5e61ace9fd5554df.tar.gz cygnal-99138976d9f0e9f94e9920af5e61ace9fd5554df.tar.bz2 cygnal-99138976d9f0e9f94e9920af5e61ace9fd5554df.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 14 |
1 files changed, 6 insertions, 8 deletions
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; } |