diff --git a/checkin_notes b/checkin_notes index fa517c89ca..b9dbdd985c 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/lib/filesys.C b/lib/filesys.C index af55b2f5fc..2893c27083 100644 --- a/lib/filesys.C +++ b/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