]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests: filesystems: fix warn_unused_result build warnings
authorAmer Al Shanawany <amer.shanawany@gmail.com>
Wed, 17 Apr 2024 18:49:13 +0000 (20:49 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 11 Jun 2024 15:21:30 +0000 (09:21 -0600)
commit2049aad5d3a6921f80121029afe6fbcfb2727861
tree2cd1aaef0af846545d8530ec192f5beb398e2479
parent4bf15b1c657d22d1d70173e43264e4606dfe75ff
selftests: filesystems: fix warn_unused_result build warnings

Fix the following warnings by adding return check and error messages.

statmount_test.c: In function ‘cleanup_namespace’:
statmount_test.c:128:9: warning: ignoring return value of ‘fchdir’
declared with attribute ‘warn_unused_result’ [-Wunused-result]
  128 |         fchdir(orig_root);
      |         ^~~~~~~~~~~~~~~~~
statmount_test.c:129:9: warning: ignoring return value of ‘chroot’
declared with attribute ‘warn_unused_result’ [-Wunused-result]
  129 |         chroot(".");
      |         ^~~~~~~~~~~

Signed-off-by: Amer Al Shanawany <amer.shanawany@gmail.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/filesystems/statmount/statmount_test.c