summaryrefslogtreecommitdiff
path: root/mercurial/osutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'mercurial/osutil.c')
-rw-r--r--mercurial/osutil.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/mercurial/osutil.c b/mercurial/osutil.c
index 5c3efb7..196d5fe 100644
--- a/mercurial/osutil.c
+++ b/mercurial/osutil.c
@@ -12,7 +12,6 @@
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
-#include <errno.h>
#ifdef _WIN32
#include <windows.h>
@@ -289,8 +288,7 @@ static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip)
#endif
if (pathlen >= PATH_MAX) {
- errno = ENAMETOOLONG;
- PyErr_SetFromErrnoWithFilename(PyExc_OSError, path);
+ PyErr_SetString(PyExc_ValueError, "path too long");
goto error_value;
}
strncpy(fullpath, path, PATH_MAX);
@@ -331,9 +329,6 @@ static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip)
err = lstat(fullpath, &st);
#endif
if (err == -1) {
- /* race with file deletion? */
- if (errno == ENOENT)
- continue;
strncpy(fullpath + pathlen + 1, ent->d_name,
PATH_MAX - pathlen);
fullpath[PATH_MAX] = 0;