From 33a88fbfdee773b1473cb5339540d79809363bdc Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Sat, 19 Mar 2011 13:59:15 +0100 Subject: Get rid of some warnings: -Wunused-result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit modules/module-default-device-restore.c: In function ‘load’: modules/module-default-device-restore.c:67: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] modules/module-default-device-restore.c:88: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result] pulsecore/authkey.c: In function ‘generate’: pulsecore/authkey.c:58: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result] pulsecore/core-util.c: In function ‘pa_make_secure_dir’: pulsecore/core-util.c:261: warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result [-Wunused-result] --- src/pulsecore/authkey.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pulsecore/authkey.c') diff --git a/src/pulsecore/authkey.c b/src/pulsecore/authkey.c index 92509d89..a590a65e 100644 --- a/src/pulsecore/authkey.c +++ b/src/pulsecore/authkey.c @@ -55,7 +55,10 @@ static int generate(int fd, void *ret_data, size_t length) { pa_random(ret_data, length); lseek(fd, (off_t) 0, SEEK_SET); - (void) ftruncate(fd, (off_t) 0); + if (ftruncate(fd, (off_t) 0) < 0) { + pa_log("Failed to truncate cookie file: %s", pa_cstrerror(errno)); + return -1; + } if ((r = pa_loop_write(fd, ret_data, length, NULL)) < 0 || (size_t) r != length) { pa_log("Failed to write cookie file: %s", pa_cstrerror(errno)); -- cgit