summaryrefslogtreecommitdiff
path: root/lib/copy-file.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-03-19 09:30:58 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-03-19 09:32:08 -0700
commit63e2bc808bf6df53af15bf527f3a4b4920033676 (patch)
treea2cd7ed4663d36409d892c1ba897ead27d32e44e /lib/copy-file.c
parentcbd4dafd96be16e8e727663decb1002883813483 (diff)
downloadgnulib-63e2bc808bf6df53af15bf527f3a4b4920033676.tar.gz
copy-file, rpmatch: fix problems found by cppcheck
Reported by Arno Onken in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00069.html>. * lib/rpmatch.c (try): Fix memory leak. * lib/copy-file.c: Include "ignore-value.h". (qcopy_file_preserving): Ignore chown value. * modules/copy-file (Depends-on): Add ignore-value.
Diffstat (limited to 'lib/copy-file.c')
-rw-r--r--lib/copy-file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/copy-file.c b/lib/copy-file.c
index 0d4dcd6a74..56605229af 100644
--- a/lib/copy-file.c
+++ b/lib/copy-file.c
@@ -37,6 +37,7 @@
#endif
#include "error.h"
+#include "ignore-value.h"
#include "safe-read.h"
#include "full-write.h"
#include "acl.h"
@@ -140,7 +141,7 @@ qcopy_file_preserving (const char *src_filename, const char *dest_filename)
#if HAVE_CHOWN
/* Preserve the owner and group. */
- chown (dest_filename, statbuf.st_uid, statbuf.st_gid);
+ ignore_value (chown (dest_filename, statbuf.st_uid, statbuf.st_gid));
#endif
/* Preserve the access permissions. */