sysctl: do not report set key in case close_stream fails
				
					
				
			As we're using buffered I/O when writing kernel parameters, write errors
may get delayed until we close the `FILE` stream. As we are currently
outputting the key that is to be set disregarding the return value of
`close_stream`, we may end up in a situation where we report error and
success:
    $ sysctl kernel.printk_ratelimit=100000000000000
    sysctl: setting key "kernel.printk_ratelimit": error code 22
    kernel.printk_ratelimit = 100000000000000
Fix the issue by only outputting the updated value in case
`close_stream` does not report an error.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
			
			
This commit is contained in:
		
				
					committed by
					
						 Craig Small
						Craig Small
					
				
			
			
				
	
			
			
			
						parent
						
							3eb4b5375f
						
					
				
				
					commit
					da82fe49b1
				
			
		Reference in New Issue
	
	Block a user