Fix is_symlink() to use S_ISLNK() macro

svn path=/trunk/boinc/; revision=15044
This commit is contained in:
Charlie Fenton 2008-04-14 09:15:01 +00:00
parent ff70bf259e
commit 4cfdf581f8
2 changed files with 9 additions and 1 deletions

View File

@ -3197,3 +3197,11 @@ David April 13 2008
client_types.C,h client_types.C,h
lib/ lib/
filesys.C filesys.C
Charlie April 14 2008
- Fix is_symlink() to use S_ISLNK() macro instead of incorrect
(sbuf.st_mode & S_IFLNK), which made it return true for regular files
and caused boinc_resolve_filename() to work incorrectly.
lib/
filesys.C

View File

@ -92,7 +92,7 @@ int is_dir(const char* path) {
int is_symlink(const char* path) { int is_symlink(const char* path) {
struct stat sbuf; struct stat sbuf;
int retval = lstat(path, &sbuf); int retval = lstat(path, &sbuf);
return (!retval && (sbuf.st_mode & S_IFLNK)); return (!retval && S_ISLNK(sbuf.st_mode));
} }
#endif #endif