Fix app request fifo wait

This commit is contained in:
vvb2060 2022-02-24 15:52:57 +08:00 committed by John Wu
parent 71e37345b4
commit 666ab1941f

View File

@ -215,10 +215,10 @@ int app_request(const shared_ptr<su_info> &info) {
exec_cmd("request", extras, info, false);
// Wait for data input for at most 70 seconds
int fd = xopen(fifo, O_RDONLY | O_CLOEXEC);
int fd = xopen(fifo, O_RDONLY | O_CLOEXEC | O_NONBLOCK);
struct pollfd pfd = {
.fd = fd,
.events = POLL_IN
.events = POLLIN
};
if (xpoll(&pfd, 1, 70 * 1000) <= 0) {
close(fd);