mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Simplify error messages when socket connect fails, suggested by "Karthik K".
This commit is contained in:
		
							
								
								
									
										9
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								client.c
									
									
									
									
									
								
							@@ -265,8 +265,13 @@ client_main(int argc, char **argv, int flags)
 | 
			
		||||
	/* Initialize the client socket and start the server. */
 | 
			
		||||
	fd = client_connect(socket_path, cmdflags & CMD_STARTSERVER);
 | 
			
		||||
	if (fd == -1) {
 | 
			
		||||
		fprintf(stderr, "failed to connect to server: %s\n",
 | 
			
		||||
		    strerror(errno));
 | 
			
		||||
		if (errno == ECONNREFUSED) {
 | 
			
		||||
			fprintf(stderr, "no server running on %s\n",
 | 
			
		||||
			    socket_path);
 | 
			
		||||
		} else {
 | 
			
		||||
			fprintf(stderr, "error connecting to %s (%s)\n",
 | 
			
		||||
			    socket_path, strerror(errno));
 | 
			
		||||
		}
 | 
			
		||||
		return (1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user