File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -100,21 +100,20 @@ namespace mongo {
100100    }
101101
102102    void  MemoryMappedFile::flush (bool  sync) {
103+         uassert (13056 , " Async flushing not supported on windows"  , sync);
104+ 
103105        if  (!view) return ;
104106
105-         //  Note: this is blocking and ignores sync
106107        bool  success = FlushViewOfFile (view, 0 ); //  0 means whole mapping
107108        if  (!success){
108109            int  err = GetLastError ();
109-             out () << " FlushViewOfFile failed "   << err << "   "  <<  endl;
110+             out () << " FlushViewOfFile failed "   << err << endl;
110111        }
111112
112-         if  (sync){
113-             bool  success = FlushFileBuffers (fd);
114-             if  (!success){
115-                 int  err = GetLastError ();
116-                 out () << " FlushFileBuffers failed "   << err << "  "   << endl;
117-             }
113+         success = FlushFileBuffers (fd);
114+         if  (!success){
115+             int  err = GetLastError ();
116+             out () << " FlushFileBuffers failed "   << err << endl;
118117        }
119118    }
120119} 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments