diff options
author | Christopher Faylor <me@cgf.cx> | 2001-12-05 23:05:15 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-12-05 23:05:15 +0000 |
commit | 5a88f2554af5cc87bc9fbb68e2712d8c7a016f4a (patch) | |
tree | 6eb74281fd0dfa0bf8a4a7d1540f2d4dc279db1d /winsup/cygwin/dir.cc | |
parent | 98a05abd051b2ad32ba227e7b2fa4dfbc733b728 (diff) | |
download | cygnal-5a88f2554af5cc87bc9fbb68e2712d8c7a016f4a.tar.gz cygnal-5a88f2554af5cc87bc9fbb68e2712d8c7a016f4a.tar.bz2 cygnal-5a88f2554af5cc87bc9fbb68e2712d8c7a016f4a.zip |
* dir.cc (opendir): Detect error return from build_fhandler_from_name.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r-- | winsup/cygwin/dir.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index 07d2ce6d9..5713c5767 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -82,13 +82,18 @@ opendir (const char *name) { fhandler_base *fh; path_conv pc; - DIR *res = NULL; + DIR *res; fh = cygheap->fdtab.build_fhandler_from_name (-1, name, NULL, pc, PC_SYM_FOLLOW | PC_FULL, NULL); - res = fh->opendir (pc); - if (!res) - delete fh; + if (!fh) + res = NULL; + else + { + res = fh->opendir (pc); + if (!res) + delete fh; + } return res; } |