Sorry to say this but it worked for me.
if ( S_ISLNK( stFileInfo.st_mode ))
mode = stFileInfo.st_mode;
if ( S_ISLNK( mode ))
printf("is link Test2\n");
All I can suggest is running it through gdb. See if the value of sbuf.st_mode is the same as mode after the assignment.
Let me know if you need help with gdb.