mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Use return value of write
This commit is contained in:
		
							parent
							
								
									979878d8af
								
							
						
					
					
						commit
						d93e53fd4b
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -158,7 +158,9 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) {
 | 
				
			||||||
	if (!(get_feature_policy(pid) & FEATURE_IPC)) {
 | 
						if (!(get_feature_policy(pid) & FEATURE_IPC)) {
 | 
				
			||||||
		sway_log(L_INFO, "Permission to connect to IPC socket denied to %d", pid);
 | 
							sway_log(L_INFO, "Permission to connect to IPC socket denied to %d", pid);
 | 
				
			||||||
		const char *error = "{\"success\": false, \"message\": \"Permission denied\"}";
 | 
							const char *error = "{\"success\": false, \"message\": \"Permission denied\"}";
 | 
				
			||||||
		write(client_fd, &error, sizeof(error));
 | 
							if (write(client_fd, &error, sizeof(error)) < (int)sizeof(error)) {
 | 
				
			||||||
 | 
								sway_log(L_DEBUG, "Failed to write entire error");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		close(client_fd);
 | 
							close(client_fd);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue