-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Lines 60 to 73 in 86a11f9
unsigned char get_d_type(struct dirent* entry, const char* location) { | |
struct stat statbuf; | |
unsigned char rv = DT_UNKNOWN; | |
if (DT_UNKNOWN == entry->d_type){ | |
char filepath[MAXSIZE]; | |
strncpy(filepath, location, MAXSIZE - 1); | |
strncat(filepath, entry->d_name, MAXSIZE - 1); | |
// The call to lstat here might not be thread safe, if the call is being made on the same file at the same time. | |
// I think there ius no way that this happens at the moment, but am not sure at all. | |
// Could globally lock this or do some sort of filesystem hash to make this more fine-grained etc. | |
if(-1 != lstat(entry->d_name, &statbuf)) |
lstat should use filepath not the file name
Metadata
Metadata
Assignees
Labels
No labels