mirror of https://github.com/BOINC/boinc.git
Fix is_file() to use S_ISREG() macro; fix is_dir() to use S_ISDIR() macro
svn path=/trunk/boinc/; revision=15063
This commit is contained in:
parent
753b20a67f
commit
8a3f4dc1e5
|
@ -3263,3 +3263,11 @@ David April 15 2008
|
|||
|
||||
client/
|
||||
hostinfo_unix.C
|
||||
|
||||
Charlie April 15 2008
|
||||
- Fix is_file() to use S_ISREG() macro instead of incorrect
|
||||
(sbuf.st_mode & S_IFREG); fix is_dir() to use S_ISDIR() macro instead of
|
||||
incorrect (sbuf.st_mode & S_IFDIR).
|
||||
|
||||
lib/
|
||||
filesys.C
|
||||
|
|
|
@ -79,13 +79,13 @@ char boinc_failed_file[256];
|
|||
int is_file(const char* path) {
|
||||
struct stat sbuf;
|
||||
int retval = stat(path, &sbuf);
|
||||
return (!retval && (sbuf.st_mode & S_IFREG));
|
||||
return (!retval && S_ISREG(sbuf.st_mode));
|
||||
}
|
||||
|
||||
int is_dir(const char* path) {
|
||||
struct stat sbuf;
|
||||
int retval = stat(path, &sbuf);
|
||||
return (!retval && (sbuf.st_mode & S_IFDIR));
|
||||
return (!retval && S_ISDIR(sbuf.st_mode));
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
|
|
Loading…
Reference in New Issue