mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Sync OpenBSD patchset 405:
Don't print exit messages when used as a login shell, requested by martynas@ a while back.
This commit is contained in:
		
							
								
								
									
										52
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								client.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
				
			|||||||
/* $Id: client.c,v 1.75 2009-09-23 15:18:56 tcunha Exp $ */
 | 
					/* $Id: client.c,v 1.76 2009-10-15 01:45:13 tcunha Exp $ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -216,30 +216,36 @@ client_main(struct client_ctx *cctx)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
out:
 | 
					out:
 | 
				
			||||||
 	if (sigterm) {
 | 
						/*
 | 
				
			||||||
 		printf("[terminated]\n");
 | 
						 * Print exit status message, unless running as a login shell where it
 | 
				
			||||||
 		return (1);
 | 
						 * would either be pointless or irritating.
 | 
				
			||||||
 	}
 | 
						 */
 | 
				
			||||||
	switch (cctx->exittype) {
 | 
						if (!login_shell) {
 | 
				
			||||||
	case CCTX_DIED:
 | 
							if (sigterm) {
 | 
				
			||||||
		printf("[lost server]\n");
 | 
								printf("[terminated]\n");
 | 
				
			||||||
		return (0);
 | 
								return (1);
 | 
				
			||||||
	case CCTX_SHUTDOWN:
 | 
							}
 | 
				
			||||||
		printf("[server exited]\n");
 | 
							switch (cctx->exittype) {
 | 
				
			||||||
		return (0);
 | 
							case CCTX_DIED:
 | 
				
			||||||
	case CCTX_EXIT:
 | 
								printf("[lost server]\n");
 | 
				
			||||||
		if (cctx->errstr != NULL) {
 | 
								return (0);
 | 
				
			||||||
			printf("[error: %s]\n", cctx->errstr);
 | 
							case CCTX_SHUTDOWN:
 | 
				
			||||||
 | 
								printf("[server exited]\n");
 | 
				
			||||||
 | 
								return (0);
 | 
				
			||||||
 | 
							case CCTX_EXIT:
 | 
				
			||||||
 | 
								if (cctx->errstr != NULL) {
 | 
				
			||||||
 | 
									printf("[error: %s]\n", cctx->errstr);
 | 
				
			||||||
 | 
									return (1);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								printf("[exited]\n");
 | 
				
			||||||
 | 
								return (0);
 | 
				
			||||||
 | 
							case CCTX_DETACH:
 | 
				
			||||||
 | 
								printf("[detached]\n");
 | 
				
			||||||
 | 
								return (0);
 | 
				
			||||||
 | 
							default:
 | 
				
			||||||
 | 
								printf("[unknown error]\n");
 | 
				
			||||||
			return (1);
 | 
								return (1);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		printf("[exited]\n");
 | 
					 | 
				
			||||||
		return (0);
 | 
					 | 
				
			||||||
	case CCTX_DETACH:
 | 
					 | 
				
			||||||
		printf("[detached]\n");
 | 
					 | 
				
			||||||
		return (0);
 | 
					 | 
				
			||||||
	default:
 | 
					 | 
				
			||||||
		printf("[unknown error]\n");
 | 
					 | 
				
			||||||
		return (1);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user