mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Portability - Solaris
- Added a SOLARIS workaround for the lack of de_type member in struct dirent that other OSes have.
This commit is contained in:
parent
0a3ee9f0a7
commit
75666c56cc
1 changed files with 9 additions and 0 deletions
|
@ -121,10 +121,19 @@ void Directory::list (
|
|||
!strcmp (de->d_name, ".."))
|
||||
continue;
|
||||
|
||||
#ifdef SOLARIS
|
||||
struct stat s;
|
||||
stat (de->d_name, &s);
|
||||
if (recursive && s.st_mode & S_IFDIR)
|
||||
list (base + "/" + de->d_name, results, recursive);
|
||||
else
|
||||
results.push_back (base + "/" + de->d_name);
|
||||
#else
|
||||
if (recursive && de->d_type == DT_DIR)
|
||||
list (base + "/" + de->d_name, results, recursive);
|
||||
else
|
||||
results.push_back (base + "/" + de->d_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
closedir (dp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue