[Lldb-commits] [lldb] r134669 - in /lldb/trunk/source: Commands/CommandCompletions.cpp Core/DataBufferMemoryMap.cpp

Jason Molenda jmolenda at apple.com
Thu Jul 7 17:38:03 PDT 2011


Author: jmolenda
Date: Thu Jul  7 19:38:03 2011
New Revision: 134669

URL: http://llvm.org/viewvc/llvm-project?rev=134669&view=rev
Log:
Switch to using the S_ISDIR and S_ISREG sys/stat.h macros in
CommandCompletions.cpp and DataBufferMemoryMap.cpp.  The file type
part of the st_mode struct member is not a bitmask.

Modified:
    lldb/trunk/source/Commands/CommandCompletions.cpp
    lldb/trunk/source/Core/DataBufferMemoryMap.cpp

Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=134669&r1=134668&r2=134669&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Thu Jul  7 19:38:03 2011
@@ -272,7 +272,7 @@
             else if (dirent_buf->d_type & DT_LNK)
             { 
                 struct stat stat_buf;
-                if ((stat(partial_name_copy, &stat_buf) == 0) && (stat_buf.st_mode & S_IFDIR))
+                if ((stat(partial_name_copy, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode))
                     isa_directory = true;
             }
             

Modified: lldb/trunk/source/Core/DataBufferMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataBufferMemoryMap.cpp?rev=134669&r1=134668&r2=134669&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataBufferMemoryMap.cpp (original)
+++ lldb/trunk/source/Core/DataBufferMemoryMap.cpp Thu Jul  7 19:38:03 2011
@@ -158,7 +158,7 @@
         struct stat stat;
         if (::fstat(fd, &stat) == 0)
         {
-            if ((stat.st_mode & S_IFREG) && (stat.st_size > offset))
+            if (S_ISREG(stat.st_mode) && (stat.st_size > offset))
             {
                 const size_t max_bytes_available = stat.st_size - offset;
                 if (length == SIZE_MAX)





More information about the lldb-commits mailing list