From a53e7877e46f55bd79e60f82353361f9c10d8866 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sat, 10 Aug 2024 11:08:39 +0200 Subject: [PATCH] unix,fs: silence -Wunused-result warning (#4496) --- src/unix/fs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/unix/fs.c b/src/unix/fs.c index aad55fed..4a4e2e3a 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -1338,9 +1338,10 @@ static ssize_t uv__fs_copyfile(uv_fs_t* req) { /* * Change the ownership and permissions of the destination file to match the * source file. - * `cp -p` does not care about errors here, so we don't either. + * `cp -p` does not care about errors here, so we don't either. Reuse the + * `result` variable to silence a -Wunused-result warning. */ - fchown(dstfd, src_statsbuf.st_uid, src_statsbuf.st_gid); + result = fchown(dstfd, src_statsbuf.st_uid, src_statsbuf.st_gid); if (fchmod(dstfd, src_statsbuf.st_mode) == -1) { err = UV__ERR(errno);