Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2006-07-05 Dick Porter <dick@ximian.com>
        * io.c (GetFileAttributes, GetFileAttributesEx): Cope with
        dangling symlinks.  Fixes bug 78664.



svn path=/branches/mono-1-1-13/mono/; revision=62270
  • Loading branch information
dickp committed Jul 5, 2006
1 parent a2a6d25 commit 8f0a649
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mono/io-layer/ChangeLog
@@ -1,3 +1,8 @@
2006-07-05 Dick Porter <dick@ximian.com>

* io.c (GetFileAttributes, GetFileAttributesEx): Cope with
dangling symlinks. Fixes bug 78664.

2006-06-23 Dick Porter <dick@ximian.com>

* handles.c (handle_cleanup):
Expand Down
11 changes: 10 additions & 1 deletion mono/io-layer/io.c
Expand Up @@ -3074,7 +3074,11 @@ guint32 GetFileAttributes (const gunichar2 *name)
}

result = stat (utf8_name, &buf);

if (result == -1 && errno == ENOENT) {
/* Might be a dangling symlink... */
result = lstat (utf8_name, &buf);
}

if (result != 0) {
_wapi_set_last_error_from_errno ();
g_free (utf8_name);
Expand Down Expand Up @@ -3134,6 +3138,11 @@ gboolean GetFileAttributesEx (const gunichar2 *name, WapiGetFileExInfoLevels lev
}

result = stat (utf8_name, &buf);
if (result == -1 && errno == ENOENT) {
/* Might be a dangling symlink... */
result = lstat (utf8_name, &buf);
}

g_free (utf8_name);

if (result != 0) {
Expand Down

0 comments on commit 8f0a649

Please sign in to comment.