Changeset 987


Ignore:
Timestamp:
12/10/2006 21:55:06 (5 years ago)
Author:
chris
Message:
  • Don't include headers that we don't have
  • Open RAID files in binary mode
File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/raidfile/RaidFileRead.cpp

    r217 r987  
    1515#include <errno.h> 
    1616#include <sys/stat.h> 
    17 #include <sys/uio.h> 
    18 #include <syslog.h> 
    1917#include <stdarg.h> 
    20 #include <dirent.h> 
     18 
     19#ifdef HAVE_SYS_UIO_H 
     20        #include <sys/uio.h> 
     21#endif 
     22 
     23#ifdef HAVE_SYSLOG_H 
     24        #include <syslog.h> 
     25#endif 
     26 
     27#ifdef HAVE_DIRENT_H 
     28        #include <dirent.h> 
     29#endif 
    2130 
    2231#include <stdio.h> 
     
    584593        // Open the parity file 
    585594        std::string parityFilename(RaidFileUtil::MakeRaidComponentName(rdiscSet, mFilename, (2 + startDisc) % READ_NUMBER_DISCS_REQUIRED)); 
    586         mParityHandle = ::open(parityFilename.c_str(), O_RDONLY, 0555); 
     595        mParityHandle = ::open(parityFilename.c_str(),  
     596                O_RDONLY | O_BINARY, 0555); 
    587597        if(mParityHandle == -1) 
    588598        { 
     
    10181028 
    10191029                // Attempt to open 
    1020                 int osFileHandle = ::open(writeFilename.c_str(), O_RDONLY, 0); 
     1030                int osFileHandle = ::open(writeFilename.c_str(),  
     1031                        O_RDONLY | O_BINARY, 0); 
    10211032                if(osFileHandle == -1) 
    10221033                { 
     
    10561067                { 
    10571068                        // Open stripe1 
    1058                         stripe1 = ::open(stripe1Filename.c_str(), O_RDONLY, 0555); 
     1069                        stripe1 = ::open(stripe1Filename.c_str(),  
     1070                                O_RDONLY | O_BINARY, 0555); 
    10591071                        if(stripe1 == -1) 
    10601072                        { 
     
    10621074                        } 
    10631075                        // Open stripe2 
    1064                         stripe2 = ::open(stripe2Filename.c_str(), O_RDONLY, 0555); 
     1076                        stripe2 = ::open(stripe2Filename.c_str(),  
     1077                                O_RDONLY | O_BINARY, 0555); 
    10651078                        if(stripe2 == -1) 
    10661079                        { 
     
    11701183                        if(existingFiles & RaidFileUtil::Stripe1Exists) 
    11711184                        { 
    1172                                 stripe1 = ::open(stripe1Filename.c_str(), O_RDONLY, 0555); 
     1185                                stripe1 = ::open(stripe1Filename.c_str(),  
     1186                                        O_RDONLY | O_BINARY, 0555); 
    11731187                                if(stripe1 == -1) 
    11741188                                { 
     
    11791193                        if(existingFiles & RaidFileUtil::Stripe2Exists) 
    11801194                        { 
    1181                                 stripe2 = ::open(stripe2Filename.c_str(), O_RDONLY, 0555); 
     1195                                stripe2 = ::open(stripe2Filename.c_str(),  
     1196                                        O_RDONLY | O_BINARY, 0555); 
    11821197                                if(stripe2 == -1) 
    11831198                                { 
     
    11861201                        } 
    11871202                        // Open parity 
    1188                         parity = ::open(parityFilename.c_str(), O_RDONLY, 0555); 
     1203                        parity = ::open(parityFilename.c_str(),  
     1204                                O_RDONLY | O_BINARY, 0555); 
    11891205                        if(parity == -1) 
    11901206                        { 
Note: See TracChangeset for help on using the changeset viewer.