comparison mercurial/osutil.c @ 7136:d834ed27199f

_listdir only uses dfd if AT_SYMLINK_NOFOLLOW is defined
author Brendan Cully <brendan@kublai.com>
date Sat, 18 Oct 2008 11:43:45 -0700
parents 8a5c88c7e97b
children aecea6934fdd
comparison
equal deleted inserted replaced
7135:06ca03380190 7136:d834ed27199f
268 268
269 static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip) 269 static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip)
270 { 270 {
271 PyObject *list, *elem, *stat, *ret = NULL; 271 PyObject *list, *elem, *stat, *ret = NULL;
272 char fullpath[PATH_MAX + 10]; 272 char fullpath[PATH_MAX + 10];
273 int kind, dfd = -1, err; 273 int kind, err;
274 struct stat st; 274 struct stat st;
275 struct dirent *ent; 275 struct dirent *ent;
276 DIR *dir; 276 DIR *dir;
277 #ifdef AT_SYMLINK_NOFOLLOW
278 int dfd = -1;
279 #endif
277 280
278 if (pathlen >= PATH_MAX) { 281 if (pathlen >= PATH_MAX) {
279 PyErr_SetString(PyExc_ValueError, "path too long"); 282 PyErr_SetString(PyExc_ValueError, "path too long");
280 goto error_value; 283 goto error_value;
281 } 284 }