mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	module-mmkbd-evdev: Don't crash on failure to close fd
If the keyboard is unplugged, it looks like the kernel is reporting back -ENODEV when trying to close the fd. This is probably a kernel error, but still, it's better to complain than to crash. Buglink: https://bugs.freedesktop.org/show_bug.cgi?id=80867 Reported-by: Stelios Bounanos Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
		
							parent
							
								
									f04e31dc5e
								
							
						
					
					
						commit
						8bfd38d6ca
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -256,8 +256,11 @@ void pa__done(pa_module*m) {
 | 
			
		|||
    if (u->io)
 | 
			
		||||
        m->core->mainloop->io_free(u->io);
 | 
			
		||||
 | 
			
		||||
    if (u->fd >= 0)
 | 
			
		||||
        pa_assert_se(pa_close(u->fd) == 0);
 | 
			
		||||
    if (u->fd >= 0) {
 | 
			
		||||
        int r = pa_close(u->fd);
 | 
			
		||||
        if (r < 0) /* https://bugs.freedesktop.org/show_bug.cgi?id=80867 */
 | 
			
		||||
            pa_log("Closing fd failed: %s", pa_cstrerror(errno));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pa_xfree(u->sink_name);
 | 
			
		||||
    pa_xfree(u);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue