Mercurial > hg
comparison mercurial/osutil.c @ 24460:73477e755cd2
osutil._listdir: rename to _listdir_stat
In upcoming patches we'll add another implementation of listdir on OS X. That
implementation will have to fall back to this one under some circumstances,
though. We'll make _listdir be able to detect those circumstances and use the
right function as appropriate.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 25 Mar 2015 16:43:29 -0700 |
parents | 2d2c0a8eeeb8 |
children | 05ccfe6763f1 |
comparison
equal
deleted
inserted
replaced
24459:7d369fae098e | 24460:73477e755cd2 |
---|---|
284 if (stat) | 284 if (stat) |
285 memcpy(&((struct listdir_stat *)stat)->st, st, sizeof(*st)); | 285 memcpy(&((struct listdir_stat *)stat)->st, st, sizeof(*st)); |
286 return stat; | 286 return stat; |
287 } | 287 } |
288 | 288 |
289 static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip) | 289 static PyObject *_listdir_stat(char *path, int pathlen, int keepstat, |
290 char *skip) | |
290 { | 291 { |
291 PyObject *list, *elem, *stat = NULL, *ret = NULL; | 292 PyObject *list, *elem, *stat = NULL, *ret = NULL; |
292 char fullpath[PATH_MAX + 10]; | 293 char fullpath[PATH_MAX + 10]; |
293 int kind, err; | 294 int kind, err; |
294 struct stat st; | 295 struct stat st; |
387 #ifdef AT_SYMLINK_NOFOLLOW | 388 #ifdef AT_SYMLINK_NOFOLLOW |
388 close(dfd); | 389 close(dfd); |
389 #endif | 390 #endif |
390 error_value: | 391 error_value: |
391 return ret; | 392 return ret; |
393 } | |
394 | |
395 static PyObject *_listdir(char *path, int pathlen, int keepstat, char *skip) | |
396 { | |
397 return _listdir_stat(path, pathlen, keepstat, skip); | |
392 } | 398 } |
393 | 399 |
394 static PyObject *statfiles(PyObject *self, PyObject *args) | 400 static PyObject *statfiles(PyObject *self, PyObject *args) |
395 { | 401 { |
396 PyObject *names, *stats; | 402 PyObject *names, *stats; |