mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:22:45 +00:00 
			
		
		
		
	Kernel: Make UserOrKernelBuffer return KResult from read/write/memset
This allows us to simplify a whole bunch of call sites with TRY(). :^)
This commit is contained in:
		
							parent
							
								
									7bf8844499
								
							
						
					
					
						commit
						b481132418
					
				
					 29 changed files with 85 additions and 118 deletions
				
			
		|  | @ -70,8 +70,7 @@ KResultOr<size_t> PCIDeviceAttributeSysFSComponent::read_bytes(off_t offset, siz | |||
|         return KSuccess; | ||||
| 
 | ||||
|     ssize_t nread = min(static_cast<off_t>(blob->size() - offset), static_cast<off_t>(count)); | ||||
|     if (!buffer.write(blob->data() + offset, nread)) | ||||
|         return KResult(EFAULT); | ||||
|     TRY(buffer.write(blob->data() + offset, nread)); | ||||
|     return nread; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling