# HG changeset patch # User Benoit Boissinot # Date 1221079027 -7200 # Node ID bdc8d00c4ffa41fd4eb6352046efb67f863f364a # Parent 75ce89ed3b6e0789f4d95017b34d6d1060cc5d92 osutil: proper error checking and reporting diff -r 75ce89ed3b6e -r bdc8d00c4ffa mercurial/osutil.c --- a/mercurial/osutil.c Wed Sep 10 09:41:42 2008 -0400 +++ b/mercurial/osutil.c Wed Sep 10 22:37:07 2008 +0200 @@ -255,7 +255,8 @@ #ifdef AT_SYMLINK_NOFOLLOW dfd = open(path, O_RDONLY); - dir = fdopendir(dfd); + if (dfd != -1) + dir = fdopendir(dfd); #else dir = opendir(path); dfd = -1;