diff options
author | Jim Meyering <meyering@redhat.com> | 2008-10-08 10:44:12 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-10-17 07:06:54 +0200 |
commit | bb7fa1e9321e6469c0738c33f5e5bb8ac3d62067 (patch) | |
tree | 73bde1a782e5e8967e91992314fcc7448cf081b4 /src/cp.c | |
parent | 16c806208576ebc5713d74e828198caba0c5fd5a (diff) | |
download | coreutils-bb7fa1e9321e6469c0738c33f5e5bb8ac3d62067.tar.xz |
maint: avoid warnings due to attribute warn_unused_result
Now that a (void) cast no longer suffices to ignore warnings from gcc
about uses of functions marked with the warn_unused_result attribute,
we need an alternative. For the record, here's one of the ignorable
warnings: "copy.c:233: warning: ignoring return value of 'fchown',
declared with attribute warn_unused_result"
* bootstrap.conf (gnulib_modules): Import ignore-value.
* src/copy.c: Include "ignore-value.h".
(set_owner): Use ignore_value in place of "(void)" casts,
to ignore lchown and fchown failures.
* src/cp.c (re_protect): Likewise, to ignore lchown failure.
* src/remove.c (preprocess_dir): Remove unnecessary "(void)" cast.
Diffstat (limited to 'src/cp.c')
-rw-r--r-- | src/cp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -29,6 +29,7 @@ #include "cp-hash.h" #include "error.h" #include "filenamecat.h" +#include "ignore-value.h" #include "lchmod.h" #include "quote.h" #include "stat-time.h" @@ -326,7 +327,7 @@ re_protect (char const *const_dst_name, size_t src_offset, } /* Failing to preserve ownership is OK. Still, try to preserve the group, but ignore the possible error. */ - (void) lchown (dst_name, -1, p->st.st_gid); + ignore_value (lchown (dst_name, -1, p->st.st_gid)); } } |