summaryrefslogtreecommitdiffstats
path: root/osdep/subprocess-posix.c
diff options
context:
space:
mode:
authorllyyr <llyyr.public@gmail.com>2023-10-23 19:34:59 +0530
committersfan5 <sfan5@live.de>2023-10-24 22:49:22 +0200
commit06c26e37edbea4a9deb3c55f6f7b8ea10fea69e8 (patch)
tree6a6c48291a5d6908eb5d3fc7b9090031363bfe81 /osdep/subprocess-posix.c
parent36403e5fd388f1421190ffe66da1eedfae5892ff (diff)
downloadmpv-06c26e37edbea4a9deb3c55f6f7b8ea10fea69e8.tar.bz2
mpv-06c26e37edbea4a9deb3c55f6f7b8ea10fea69e8.tar.xz
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.
Diffstat (limited to 'osdep/subprocess-posix.c')
-rw-r--r--osdep/subprocess-posix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/osdep/subprocess-posix.c b/osdep/subprocess-posix.c
index 013ca143ed..2d81b9a10f 100644
--- a/osdep/subprocess-posix.c
+++ b/osdep/subprocess-posix.c
@@ -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);
}