mirror of
https://github.com/tmux/tmux.git
synced 2024-12-25 02:48:47 +00:00
Sync OpenBSD patchset 406:
Do this in a better way - print messages when exiting with nonzero. Also remove the login shell information from server-info, only the client should care about it.
This commit is contained in:
parent
9800dc4697
commit
6257be6371
7
client.c
7
client.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: client.c,v 1.76 2009-10-15 01:45:13 tcunha Exp $ */
|
/* $OpenBSD: client.c,v 1.24 2009/10/13 13:15:26 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -220,7 +220,6 @@ out:
|
|||||||
* Print exit status message, unless running as a login shell where it
|
* Print exit status message, unless running as a login shell where it
|
||||||
* would either be pointless or irritating.
|
* would either be pointless or irritating.
|
||||||
*/
|
*/
|
||||||
if (!login_shell) {
|
|
||||||
if (sigterm) {
|
if (sigterm) {
|
||||||
printf("[terminated]\n");
|
printf("[terminated]\n");
|
||||||
return (1);
|
return (1);
|
||||||
@ -230,6 +229,7 @@ out:
|
|||||||
printf("[lost server]\n");
|
printf("[lost server]\n");
|
||||||
return (0);
|
return (0);
|
||||||
case CCTX_SHUTDOWN:
|
case CCTX_SHUTDOWN:
|
||||||
|
if (!login_shell)
|
||||||
printf("[server exited]\n");
|
printf("[server exited]\n");
|
||||||
return (0);
|
return (0);
|
||||||
case CCTX_EXIT:
|
case CCTX_EXIT:
|
||||||
@ -237,9 +237,11 @@ out:
|
|||||||
printf("[error: %s]\n", cctx->errstr);
|
printf("[error: %s]\n", cctx->errstr);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
if (!login_shell)
|
||||||
printf("[exited]\n");
|
printf("[exited]\n");
|
||||||
return (0);
|
return (0);
|
||||||
case CCTX_DETACH:
|
case CCTX_DETACH:
|
||||||
|
if (!login_shell)
|
||||||
printf("[detached]\n");
|
printf("[detached]\n");
|
||||||
return (0);
|
return (0);
|
||||||
default:
|
default:
|
||||||
@ -247,7 +249,6 @@ out:
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
client_msg_dispatch(struct client_ctx *cctx)
|
client_msg_dispatch(struct client_ctx *cctx)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-server-info.c,v 1.28 2009-09-07 23:59:19 tcunha Exp $ */
|
/* $OpenBSD: cmd-server-info.c,v 1.11 2009/10/13 13:15:26 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -68,9 +68,8 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx)
|
|||||||
*strchr(tim, '\n') = '\0';
|
*strchr(tim, '\n') = '\0';
|
||||||
ctx->print(ctx,
|
ctx->print(ctx,
|
||||||
"tmux " BUILD ", pid %ld, started %s", (long) getpid(), tim);
|
"tmux " BUILD ", pid %ld, started %s", (long) getpid(), tim);
|
||||||
ctx->print(ctx, "socket path %s, debug level %d%s%s",
|
ctx->print(ctx, "socket path %s, debug level %d%s",
|
||||||
socket_path, debug_level, be_quiet ? ", quiet" : "",
|
socket_path, debug_level, be_quiet ? ", quiet" : "");
|
||||||
login_shell ? ", login shell" : "");
|
|
||||||
if (uname(&un) == 0) {
|
if (uname(&un) == 0) {
|
||||||
ctx->print(ctx, "system is %s %s %s %s",
|
ctx->print(ctx, "system is %s %s %s %s",
|
||||||
un.sysname, un.release, un.version, un.machine);
|
un.sysname, un.release, un.version, un.machine);
|
||||||
|
Loading…
Reference in New Issue
Block a user