mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
This commit is contained in:
		
							
								
								
									
										2
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								client.c
									
									
									
									
									
								
							| @@ -434,7 +434,7 @@ client_stdin_callback(__unused int fd, __unused short events, | ||||
| 	struct msg_stdin_data	data; | ||||
|  | ||||
| 	data.size = read(STDIN_FILENO, data.data, sizeof data.data); | ||||
| 	if (data.size < 0 && (errno == EINTR || errno == EAGAIN)) | ||||
| 	if (data.size == -1 && (errno == EINTR || errno == EAGAIN)) | ||||
| 		return; | ||||
|  | ||||
| 	proc_send(client_peer, MSG_STDIN, -1, &data, sizeof data); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 deraadt
					deraadt