changeset 7026:3e49127bcec3

osutil: proper error checking and reporting
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 10 Sep 2008 22:37:07 +0200
parents 766d8cb8c622
children ab57069232b4 9d023ef7b467
files mercurial/osutil.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/osutil.c	Wed Sep 10 13:52:33 2008 +0200
+++ 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;