mercurial/osutil.c
changeset 24460 73477e755cd2
parent 23966 2d2c0a8eeeb8
child 24461 05ccfe6763f1
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;