commit-fix: RV_DETACH in client.c; if is now switch

This commit is contained in:
Michael Krayer 2023-10-11 15:07:42 +02:00
parent 6c6b505327
commit 64d897db14
1 changed files with 8 additions and 7 deletions

View File

@ -123,12 +123,13 @@ static int client_mainloop(void) {
debug("client-stdin: %c\n", pkt.u.msg[0]);
if (client.await_command) {
client.await_command = false;
if (pkt.u.msg[0]=='d') {
pkt.type = MSG_DETACH;
pkt.len = 0;
client_send_packet(&pkt);
close(server.socket);
return -1;
switch (pkt.u.msg[0]) {
case 'd':
pkt.type = MSG_DETACH;
pkt.len = 0;
client_send_packet(&pkt);
close(server.socket);
return RV_DETACH;
}
}
pkt.len = len;
@ -141,7 +142,7 @@ static int client_mainloop(void) {
}
} else if (len == 0) {
debug("client-stdin: EOF\n");
return -1;
return RV_DETACH;
}
}
}