diff options
author | Christopher Faylor <me@cgf.cx> | 2002-01-06 03:32:32 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-01-06 03:32:32 +0000 |
commit | 9125cbd7cf47b848390294897561c556a8d8b572 (patch) | |
tree | 5e30b22d3069e54636ab0d4b77a5ffcf551bb230 /winsup | |
parent | fcb76c5dcb8f99207c876b64d12891945795596f (diff) | |
download | cygnal-9125cbd7cf47b848390294897561c556a8d8b572.tar.gz cygnal-9125cbd7cf47b848390294897561c556a8d8b572.tar.bz2 cygnal-9125cbd7cf47b848390294897561c556a8d8b572.zip |
* dir.cc (opendir): Guarantee release of alloced fhandler structure on error.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 13 | ||||
-rw-r--r-- | winsup/cygwin/dir.cc | 12 |
2 files changed, 16 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1c7b8ef34..868bc89d5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,8 +1,13 @@ -2001-01-05 Corinna Vinschen <corinna@vinschen.de> +2002-01-05 Christopher Faylor <cgf@redhat.com> - exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN. + * dir.cc (opendir): Guarantee release of alloced fhandler structure on + error. -2001-01-05 Corinna Vinschen <corinna@vinschen.de> +2002-01-05 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN. + +2002-01-05 Corinna Vinschen <corinna@vinschen.de> * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULL handle as errorneous. @@ -15,7 +20,7 @@ * dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT. -2001-01-04 Corinna Vinschen <corinna@vinschen.de> +2002-01-04 Corinna Vinschen <corinna@vinschen.de> * net.cc: Replace usage of AF_UNIX by Posix compliant AF_LOCAL throughout. diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index 44db5d7be..40411b48c 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -88,14 +88,16 @@ opendir (const char *name) PC_SYM_FOLLOW | PC_FULL, NULL); if (!fh) res = NULL; - else if (!pc.exists ()) - set_errno (ENOENT); + else if (pc.exists ()) + res = fh->opendir (pc); else { - res = fh->opendir (pc); - if (!res) - delete fh; + set_errno (ENOENT); + res = NULL; } + + if (!res && fh) + delete fh; return res; } |