mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-14 05:33:59 -04:00
slave: restore pts file status flags after emitting user-notifications
We (need to) set O_NONBLOCK on the pts file description before emitting the user-notifications, to ensure we don't block in write(3). However, since file status flags are per *file*, not per file *descriptor*, this ends up setting O_NONBLOCK on the dup:ed stdin/stdout/stderr file descriptors too. Not all clients want this, or can handle this. Thus we need to restore the original flags before exec:ing the client. This fixes "makepkg" build failures.
This commit is contained in:
parent
a7d21c5c7f
commit
1da8142f32
1 changed files with 5 additions and 3 deletions
8
slave.c
8
slave.c
|
|
@ -202,10 +202,12 @@ slave_exec(int ptmx, char *argv[], int err_fd, bool login_shell,
|
||||||
goto err;
|
goto err;
|
||||||
if (fcntl(pts, F_SETFL, flags | O_NONBLOCK) < 0)
|
if (fcntl(pts, F_SETFL, flags | O_NONBLOCK) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
|
|
||||||
if (!emit_notifications(pts, notifications))
|
if (!emit_notifications(pts, notifications))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
fcntl(pts, F_SETFL, flags);
|
||||||
|
}
|
||||||
|
|
||||||
close(pts);
|
close(pts);
|
||||||
pts = -1;
|
pts = -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue