Fix 100% CPU on dead SSH sessions with 'darling shell'

This commit is contained in:
Lubos Dolezel 2018-07-18 12:52:27 +02:00
parent a9cb3b9f7b
commit f7b18e30be

View File

@ -409,6 +409,8 @@ static void shellLoop(int sockfd, int master)
rd = read(STDIN_FILENO, buf, sizeof(buf));
if (rd > 0)
write(master, buf, rd);
else
exit(1);
}
while (rd == sizeof(buf));
}