osutil: proper error checking and reporting
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 10 Sep 2008 22:37:07 +0200
changeset 7022 bdc8d00c4ffa
parent 7021 75ce89ed3b6e
child 7023 74be9d0c665c
osutil: proper error checking and reporting
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;