@@ -308,23 +308,39 @@ static void terminfo_start(UI *ui)
308
308
// Enable bracketed paste
309
309
unibi_out_ext(ui, data->unibi_ext.enable_bracketed_paste);
310
310
311
+
int ret;
311
312
uv_loop_init(&data->write_loop);
312
313
if (data->out_isatty) {
313
-
uv_tty_init(&data->write_loop, &data->output_handle.tty, data->out_fd, 0);
314
+
ret = uv_tty_init(&data->write_loop, &data->output_handle.tty, data->out_fd, 0);
315
+
if (ret) {
316
+
ELOG("uv_tty_init failed: %s", uv_strerror(ret));
317
+
}
314
318
#ifdef WIN32
315
-
uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_RAW);
319
+
ret = uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_RAW);
320
+
if (ret) {
321
+
ELOG("uv_tty_set_mode failed: %s", uv_strerror(ret));
322
+
}
316
323
#else
317
324
int retry_count = 10;
318
325
// A signal may cause uv_tty_set_mode() to fail (e.g., SIGCONT). Retry a
319
326
// few times. #12322
320
-
while (uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_IO) == UV_EINTR
327
+
while ((ret = uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_IO)) == UV_EINTR
321
328
&& retry_count > 0) {
322
329
retry_count--;
323
330
}
331
+
if (ret) {
332
+
ELOG("uv_tty_set_mode failed: %s", uv_strerror(ret));
333
+
}
324
334
#endif
325
335
} else {
326
-
uv_pipe_init(&data->write_loop, &data->output_handle.pipe, 0);
327
-
uv_pipe_open(&data->output_handle.pipe, data->out_fd);
336
+
ret = uv_pipe_init(&data->write_loop, &data->output_handle.pipe, 0);
337
+
if (ret) {
338
+
ELOG("uv_pipe_init failed: %s", uv_strerror(ret));
339
+
}
340
+
ret = uv_pipe_open(&data->output_handle.pipe, data->out_fd);
341
+
if (ret) {
342
+
ELOG("uv_pipe_open failed: %s", uv_strerror(ret));
343
+
}
328
344
}
329
345
flush_buf(ui);
330
346
}
@@ -1086,8 +1102,14 @@ static void tui_mode_change(UI *ui, String mode, Integer mode_idx)
1086
1102
// after calling uv_tty_set_mode. So, set the mode of the TTY again here.
1087
1103
// #13073
1088
1104
if (data->is_starting && data->input.in_fd == STDERR_FILENO) {
1089
-
uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_NORMAL);
1090
-
uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_IO);
1105
+
int ret = uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_NORMAL);
1106
+
if (ret) {
1107
+
ELOG("uv_tty_set_mode failed: %s", uv_strerror(ret));
1108
+
}
1109
+
ret = uv_tty_set_mode(&data->output_handle.tty, UV_TTY_MODE_IO);
1110
+
if (ret) {
1111
+
ELOG("uv_tty_set_mode failed: %s", uv_strerror(ret));
1112
+
}
1091
1113
}
1092
1114
#endif
1093
1115
tui_set_mode(ui, (ModeShape)mode_idx);
@@ -2081,8 +2103,11 @@ static void flush_buf(UI *ui)
2081
2103
fwrite(bufs[i].base, bufs[i].len, 1, data->screenshot);
2082
2104
}
2083
2105
} else {
2084
-
uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle),
2085
-
bufs, (unsigned)(bufp - bufs), NULL);
2106
+
int ret = uv_write(&req, STRUCT_CAST(uv_stream_t, &data->output_handle),
2107
+
bufs, (unsigned)(bufp - bufs), NULL);
2108
+
if (ret) {
2109
+
ELOG("uv_write failed: %s", uv_strerror(ret));
2110
+
}
2086
2111
uv_run(&data->write_loop, UV_RUN_DEFAULT);
2087
2112
}
2088
2113
data->bufpos = 0;
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4