mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	bluez5: use nonblocking i/o for SCO
Although SCO sockets usually don't block, they could, so do nonblocking reads/writes.
This commit is contained in:
		
							parent
							
								
									13a9964a71
								
							
						
					
					
						commit
						73d7252f24
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -89,7 +89,7 @@ static void sco_io_on_ready(struct spa_source *source)
 | 
				
			||||||
		int res;
 | 
							int res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	read_again:
 | 
						read_again:
 | 
				
			||||||
		res = read(io->fd, io->read_buffer, SPA_MIN(io->read_mtu, MAX_MTU));
 | 
							res = recv(io->fd, io->read_buffer, SPA_MIN(io->read_mtu, MAX_MTU), MSG_DONTWAIT);
 | 
				
			||||||
		if (res <= 0) {
 | 
							if (res <= 0) {
 | 
				
			||||||
			if (errno == EINTR) {
 | 
								if (errno == EINTR) {
 | 
				
			||||||
				/* retry if interrupted */
 | 
									/* retry if interrupted */
 | 
				
			||||||
| 
						 | 
					@ -165,7 +165,7 @@ int spa_bt_sco_io_write(struct spa_bt_sco_io *io, uint8_t *buf, int size)
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
		int written;
 | 
							int written;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		written = write(io->fd, buf, packet_size);
 | 
							written = send(io->fd, buf, packet_size, MSG_DONTWAIT | MSG_NOSIGNAL);
 | 
				
			||||||
		if (written < 0) {
 | 
							if (written < 0) {
 | 
				
			||||||
			if (errno == EINTR) {
 | 
								if (errno == EINTR) {
 | 
				
			||||||
				/* retry if interrupted */
 | 
									/* retry if interrupted */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue