merge with crew
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sat, 18 Oct 2008 21:11:44 +0200
changeset 7140 beeeb0cd73e7
parent 7139 bcbba59e233d (current diff)
parent 7137 0c63b87d9bce (diff)
child 7141 8d1bdaf842de
merge with crew
--- a/mercurial/osutil.c	Sat Oct 18 21:08:44 2008 +0200
+++ b/mercurial/osutil.c	Sat Oct 18 21:11:44 2008 +0200
@@ -270,10 +270,13 @@
 {
 	PyObject *list, *elem, *stat, *ret = NULL;
 	char fullpath[PATH_MAX + 10];
-	int kind, dfd = -1, err;
+	int kind, err;
 	struct stat st;
 	struct dirent *ent;
 	DIR *dir;
+#ifdef AT_SYMLINK_NOFOLLOW
+	int dfd = -1;
+#endif
 
 	if (pathlen >= PATH_MAX) {
 		PyErr_SetString(PyExc_ValueError, "path too long");
--- a/mercurial/util.py	Sat Oct 18 21:08:44 2008 +0200
+++ b/mercurial/util.py	Sat Oct 18 21:11:44 2008 +0200
@@ -865,7 +865,9 @@
                 # handle directory not found in Python version prior to 2.5
                 # Python <= 2.4 returns native Windows code 3 in errno
                 # Python >= 2.5 returns ENOENT and adds winerror field
-                if err.errno not in (3, errno.ENOENT, errno.ENOTDIR):
+                # EINVAL is raised if dir is not a directory.
+                if err.errno not in (3, errno.ENOENT, errno.EINVAL,
+                                     errno.ENOTDIR):
                     raise
                 dmap = {}
             cache = dircache.setdefault(dir, dmap)