mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-23 08:33:17 +01:00
Set exittype for error exit as well as the error string.
This commit is contained in:
parent
74c35c513e
commit
7a4bac82d7
6
client.c
6
client.c
@ -219,9 +219,12 @@ client_main(struct client_ctx *cctx)
|
||||
case CCTX_DETACH:
|
||||
printf("[detached]\n");
|
||||
return (0);
|
||||
default:
|
||||
case CCTX_ERROR:
|
||||
printf("[error: %s]\n", cctx->errstr);
|
||||
return (1);
|
||||
default:
|
||||
printf("[error: unknown error]\n");
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,6 +278,7 @@ client_msg_dispatch(struct client_ctx *cctx)
|
||||
|
||||
printdata.msg[(sizeof printdata.msg) - 1] = '\0';
|
||||
cctx->errstr = xstrdup(printdata.msg);
|
||||
cctx->exittype = CCTX_ERROR;
|
||||
imsg_free(&imsg);
|
||||
return (-1);
|
||||
case MSG_EXIT:
|
||||
|
Loading…
Reference in New Issue
Block a user