Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/sched_ext: Fix unused-result warning for read()

The read() call in run_test() triggers a warn_unused_result compiler
warning, which breaks the build under -Werror.

Check the return value of read() and exit the child process on failure to
satisfy the compiler and handle pipe read errors.

Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Cheng-Yang Chou and committed by
Tejun Heo
1f063860 9d851afa

+2 -1
+2 -1
tools/testing/selftests/sched_ext/init_enable_count.c
··· 57 57 char buf; 58 58 59 59 close(pipe_fds[1]); 60 - read(pipe_fds[0], &buf, 1); 60 + if (read(pipe_fds[0], &buf, 1) < 0) 61 + exit(1); 61 62 close(pipe_fds[0]); 62 63 exit(0); 63 64 }