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: filesystems: fix warn_unused_result build warnings

Add return value checks for read & write calls in test_listmount_ns
function. This patch resolves below compilation warnings:

```
statmount_test_ns.c: In function ‘test_listmount_ns’:

statmount_test_ns.c:322:17: warning: ignoring return value of ‘write’
declared with attribute ‘warn_unused_result’ [-Wunused-result]

statmount_test_ns.c:323:17: warning: ignoring return value of ‘read’
declared with attribute ‘warn_unused_result’ [-Wunused-result]
```

Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Abhinav Jain and committed by
Shuah Khan
b4bcdff7 611fbeb4

+5 -2
+5 -2
tools/testing/selftests/filesystems/statmount/statmount_test_ns.c
··· 319 319 * Tell our parent how many mounts we have, and then wait for it 320 320 * to tell us we're done. 321 321 */ 322 - write(child_ready_pipe[1], &nr_mounts, sizeof(nr_mounts)); 323 - read(parent_ready_pipe[0], &cval, sizeof(cval)); 322 + if (write(child_ready_pipe[1], &nr_mounts, sizeof(nr_mounts)) != 323 + sizeof(nr_mounts)) 324 + ret = NSID_ERROR; 325 + if (read(parent_ready_pipe[0], &cval, sizeof(cval)) != sizeof(cval)) 326 + ret = NSID_ERROR; 324 327 exit(NSID_PASS); 325 328 } 326 329