mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-10-29 05:40:25 -04:00 
			
		
		
		
	ucm: handle better the system() call
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
		
							parent
							
								
									8f5779eb3f
								
							
						
					
					
						commit
						7e4390137a
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		|  | @ -713,8 +713,18 @@ static int execute_sequence(snd_use_case_mgr_t *uc_mgr, | |||
| 			break; | ||||
| 		case SEQUENCE_ELEMENT_TYPE_EXEC: | ||||
| 			err = system(s->data.exec); | ||||
| 			if (err < 0) | ||||
| 			if (WIFSIGNALED(err)) { | ||||
| 				err = -EINTR; | ||||
| 			} if (WIFEXITED(err)) { | ||||
| 				if (WEXITSTATUS(err) != 0) { | ||||
| 					uc_error("command '%s' failed (exit code %d)", s->data.exec, WEXITSTATUS(err)); | ||||
| 					err = -EINVAL; | ||||
| 					goto __fail; | ||||
| 				} | ||||
| 			} else if (err < 0) { | ||||
| 				err = -errno; | ||||
| 				goto __fail; | ||||
| 			} | ||||
| 			break; | ||||
| 		case SEQUENCE_ELEMENT_TYPE_CMPT_SEQ: | ||||
| 			/* Execute enable or disable sequence of a component
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jaroslav Kysela
						Jaroslav Kysela