mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	pcm: minor code cleanup for ioctl call
When error occurs, return value from ioctl(2) is -1 and error code can be got thread local variable, errno. It's OK just to check the return value without any assignment. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
		
							parent
							
								
									f10bc243e4
								
							
						
					
					
						commit
						8beab3eb8a
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -132,8 +132,7 @@ static int sync_ptr1(snd_pcm_hw_t *hw, unsigned int flags)
 | 
			
		|||
{
 | 
			
		||||
	int err;
 | 
			
		||||
	hw->sync_ptr->flags = flags;
 | 
			
		||||
	err = ioctl((hw)->fd, SNDRV_PCM_IOCTL_SYNC_PTR, (hw)->sync_ptr);
 | 
			
		||||
	if (err < 0) {
 | 
			
		||||
	if (ioctl(hw->fd, SNDRV_PCM_IOCTL_SYNC_PTR, hw->sync_ptr) < 0) {
 | 
			
		||||
		err = -errno;
 | 
			
		||||
		SYSMSG("SNDRV_PCM_IOCTL_SYNC_PTR failed (%i)", err);
 | 
			
		||||
		return err;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue