From 4cfdf581f80c21d45f0dfc6cf763f558c5367e2c Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 14 Apr 2008 09:15:01 +0000 Subject: [PATCH] Fix is_symlink() to use S_ISLNK() macro svn path=/trunk/boinc/; revision=15044 --- checkin_notes | 8 ++++++++ lib/filesys.C | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 5d5329ad76..e3078bde8f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3197,3 +3197,11 @@ David April 13 2008 client_types.C,h lib/ 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 diff --git a/lib/filesys.C b/lib/filesys.C index ff8b0974f3..af55b2f5fc 100644 --- a/lib/filesys.C +++ b/lib/filesys.C @@ -92,7 +92,7 @@ int is_dir(const char* path) { int is_symlink(const char* path) { struct stat sbuf; int retval = lstat(path, &sbuf); - return (!retval && (sbuf.st_mode & S_IFLNK)); + return (!retval && S_ISLNK(sbuf.st_mode)); } #endif