diff options
author | Tiago Cunha <tcunha@gmx.com> | 2011-03-19 23:27:35 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2011-03-19 23:27:35 +0000 |
commit | d0cca3924ec7d04321259264b23d0e083f2414c5 (patch) | |
tree | a50a2f8880052862058ea994886e0f184c280933 /cmd-detach-client.c | |
parent | 34bb013b92a61233cc9feed7866a660e22693265 (diff) |
Sync OpenBSD patchset 863:
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.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd-detach-client.c b/cmd-detach-client.c index 52792b56..6052a790 100644 --- a/cmd-detach-client.c +++ b/cmd-detach-client.c @@ -1,4 +1,4 @@ -/* $Id: cmd-detach-client.c,v 1.12 2011-01-07 14:45:34 tcunha Exp $ */ +/* $Id: cmd-detach-client.c,v 1.13 2011-03-19 23:27:35 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); } |