mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	Kernel: Use TRY() more in process-specific ProcFS code
This commit is contained in:
		
							parent
							
								
									f4a6b60570
								
							
						
					
					
						commit
						398f8e7c96
					
				
					 2 changed files with 4 additions and 19 deletions
				
			
		|  | @ -172,29 +172,17 @@ KResultOr<size_t> ProcFSExposedLink::read_bytes(off_t offset, size_t count, User | |||
| 
 | ||||
| KResultOr<NonnullRefPtr<Inode>> ProcFSExposedLink::to_inode(const ProcFS& procfs_instance) const | ||||
| { | ||||
|     auto maybe_inode = ProcFSLinkInode::try_create(procfs_instance, *this); | ||||
|     if (maybe_inode.is_error()) | ||||
|         return maybe_inode.error(); | ||||
| 
 | ||||
|     return maybe_inode.release_value(); | ||||
|     return TRY(ProcFSLinkInode::try_create(procfs_instance, *this)); | ||||
| } | ||||
| 
 | ||||
| KResultOr<NonnullRefPtr<Inode>> ProcFSExposedComponent::to_inode(const ProcFS& procfs_instance) const | ||||
| { | ||||
|     auto maybe_inode = ProcFSGlobalInode::try_create(procfs_instance, *this); | ||||
|     if (maybe_inode.is_error()) | ||||
|         return maybe_inode.error(); | ||||
| 
 | ||||
|     return maybe_inode.release_value(); | ||||
|     return TRY(ProcFSGlobalInode::try_create(procfs_instance, *this)); | ||||
| } | ||||
| 
 | ||||
| KResultOr<NonnullRefPtr<Inode>> ProcFSExposedDirectory::to_inode(const ProcFS& procfs_instance) const | ||||
| { | ||||
|     auto maybe_inode = ProcFSDirectoryInode::try_create(procfs_instance, *this); | ||||
|     if (maybe_inode.is_error()) | ||||
|         return maybe_inode.error(); | ||||
| 
 | ||||
|     return maybe_inode.release_value(); | ||||
|     return TRY(ProcFSDirectoryInode::try_create(procfs_instance, *this)); | ||||
| } | ||||
| 
 | ||||
| void ProcFSExposedDirectory::add_component(const ProcFSExposedComponent&) | ||||
|  |  | |||
|  | @ -112,10 +112,7 @@ KResultOr<NonnullRefPtr<Inode>> Process::lookup_file_descriptions_directory(cons | |||
|     if (!fds().get_if_valid(*maybe_index)) | ||||
|         return ENOENT; | ||||
| 
 | ||||
|     auto maybe_inode = ProcFSProcessPropertyInode::try_create_for_file_description_link(procfs, *maybe_index, pid()); | ||||
|     if (maybe_inode.is_error()) | ||||
|         return maybe_inode.error(); | ||||
|     return maybe_inode.release_value(); | ||||
|     return TRY(ProcFSProcessPropertyInode::try_create_for_file_description_link(procfs, *maybe_index, pid())); | ||||
| } | ||||
| 
 | ||||
| KResult Process::procfs_get_pledge_stats(KBufferBuilder& builder) const | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling