# HG changeset patch # User Benoit Boissinot # Date 1224357104 -7200 # Node ID beeeb0cd73e753941cc559c82f11c3d3f352fc5f # Parent bcbba59e233db99d7668a0980add2c501636938d# Parent 0c63b87d9bceb608d67d6395b854e45cf01e69eb merge with crew diff -r bcbba59e233d -r beeeb0cd73e7 mercurial/osutil.c --- 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"); diff -r bcbba59e233d -r beeeb0cd73e7 mercurial/util.py --- 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)