udp: Convey transmit path errors to the caller.
The transport layer's functional interface foresees having error codes percolate back up to the caller. However, up until now, the udp module simply returned -1 for any error. This patch lets the code return the specific error instead. Signed-off-by: Richard Cochran <richardcochran@gmail.com>
This commit is contained in:
		
							parent
							
								
									306ac67460
								
							
						
					
					
						commit
						d4fbb0701d
					
				
							
								
								
									
										2
									
								
								udp.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								udp.c
									
									
									
									
									
								
							@ -256,7 +256,7 @@ static int udp_send(struct transport *t, struct fdarray *fda,
 | 
				
			|||||||
	cnt = sendto(fd, buf, len, 0, &addr->sa, sizeof(addr->sin));
 | 
						cnt = sendto(fd, buf, len, 0, &addr->sa, sizeof(addr->sin));
 | 
				
			||||||
	if (cnt < 1) {
 | 
						if (cnt < 1) {
 | 
				
			||||||
		pr_err("sendto failed: %m");
 | 
							pr_err("sendto failed: %m");
 | 
				
			||||||
		return cnt;
 | 
							return -errno;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Get the time stamp right away.
 | 
						 * Get the time stamp right away.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user