mirror of https://github.com/mpv-player/mpv
osdep: fix clang warnings with `_FORTIFY_SOURCE`
This fixes warnings generated for `-Wunused-result` when mpv is built with `-O1 -D_FORTIFY_SOURCE=1` or higher on clang since read/write functions are declared with the `warn_unused_result` attribute. Cast to void to avoid these warnings.
This commit is contained in:
parent
36403e5fd3
commit
06c26e37ed
|
@ -134,7 +134,7 @@ static pid_t spawn_process(const char *path, struct mp_subprocess_opts *opts,
|
|||
as_execvpe(path, opts->exe, opts->args, opts->env ? opts->env : environ);
|
||||
|
||||
child_failed:
|
||||
write(p[1], &(char){1}, 1); // shouldn't be able to fail
|
||||
(void)write(p[1], &(char){1}, 1); // shouldn't be able to fail
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -435,7 +435,7 @@ static void *terminal_thread(void *ptr)
|
|||
}
|
||||
if (fds[1].revents & POLLIN) {
|
||||
int8_t c = -1;
|
||||
read(stop_cont_pipe[0], &c, 1);
|
||||
(void)read(stop_cont_pipe[0], &c, 1);
|
||||
if (c == PIPE_STOP)
|
||||
do_deactivate_getch2();
|
||||
else if (c == PIPE_CONT)
|
||||
|
|
Loading…
Reference in New Issue