summaryrefslogtreecommitdiffstats
path: root/cmd-detach-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-03-03 08:51:47 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-03-03 08:51:47 +0000
commit7954126dcd6ec52020fde92c8be997482fa55ab6 (patch)
tree9e6dd32471652321eae8d53661d8ac473f993d97 /cmd-detach-client.c
parentce91520e12d1f7460fb52df27b38a3e2937e325f (diff)
Add a -P option to detach to HUP the client's parent process (usually
causing it to exit as well).
Diffstat (limited to 'cmd-detach-client.c')
-rw-r--r--cmd-detach-client.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd-detach-client.c b/cmd-detach-client.c
index 03789bd8..12723ac4 100644
--- a/cmd-detach-client.c
+++ b/cmd-detach-client.c
@@ -28,8 +28,8 @@ int cmd_detach_client_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_detach_client_entry = {
"detach-client", "detach",
- "t:", 0, 0,
- CMD_TARGET_CLIENT_USAGE,
+ "t:P", 0, 0,
+ "[-P] " CMD_TARGET_CLIENT_USAGE,
CMD_READONLY,
NULL,
NULL,
@@ -45,7 +45,10 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_ctx *ctx)
if ((c = cmd_find_client(ctx, args_get(args, 't'))) == NULL)
return (-1);
- server_write_client(c, MSG_DETACH, NULL, 0);
+ if (args_has(args, 'P'))
+ server_write_client(c, MSG_DETACHKILL, NULL, 0);
+ else
+ server_write_client(c, MSG_DETACH, NULL, 0);
return (0);
}