diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-08-18 14:22:07 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-08-18 14:22:07 +0000 |
commit | 75a3b85877941516c8430603f876019b916a6240 (patch) | |
tree | d03fe18d97da98508b346ddf13ffa08c5cc97405 /winsup/cygwin/path.cc | |
parent | d15ed91c04e3499de636b33ab59443049b94a815 (diff) | |
download | cygnal-75a3b85877941516c8430603f876019b916a6240.tar.gz cygnal-75a3b85877941516c8430603f876019b916a6240.tar.bz2 cygnal-75a3b85877941516c8430603f876019b916a6240.zip |
* exceptions.cc (open_stackdumpfile): Don't try to open file if we
have no filesystem based CWD. Add comment.
* path.cc (cwdstuff::set): Set CWD handle to NULL if CWD is a virtual
path. Simplify matching comment.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index ee7d186eb..00a9c1d65 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3321,9 +3321,9 @@ cwdstuff::set (path_conv *nat_cwd, const char *posix_cwd) /* Open a directory handle with FILE_OPEN_FOR_BACKUP_INTENT and with all sharing flags set. The handle is right now used in exceptions.cc only, but that might change in future. */ + HANDLE h = NULL; if (!virtual_path) { - HANDLE h; NTSTATUS status; IO_STATUS_BLOCK io; OBJECT_ATTRIBUTES attr; @@ -3363,18 +3363,11 @@ cwdstuff::set (path_conv *nat_cwd, const char *posix_cwd) __seterrno_from_nt_status (status); return -1; } - /* Note that we don't set the dir handle to NULL for virtual paths. - The handle is used to generate a stackdump file. Since we can't - create a stackdump in a virtual path, we have at least *some* - directory handle to generate the stackdump in. - - However, note that we have to make sure that we don't use the handle - wrongly as soon as we start to use it in other cases as well. */ - HANDLE old_dir = dir; - dir = h; - if (old_dir) - NtClose (old_dir); } + /* Set new handle. It's only used when creating stackdumps so far. */ + if (dir) + NtClose (dir); + dir = h; if (!nat_cwd) { |