Check write() call for failures.

This commit is contained in:
Dianne Skoll
2023-12-28 18:23:13 -05:00
parent 7fe3eb7391
commit 04b349c6c7

View File

@@ -1032,6 +1032,11 @@ guess_terminal_background(int *r, int *g, int *b)
tty_raw(ttyfd);
n = write(ttyfd, "\033]11;?\033\\", 8);
if (n != 8) {
/* write failed... WTF? Not much we can do */
return;
}
/* Wait up to 0.1s for terminal to respond */
p.fd = ttyfd;
p.events = POLLIN;