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/core-util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/pulsecore/core-util.c') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index b5043a38..13d0bb5e 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -259,11 +259,12 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) { } #ifdef HAVE_FCHOWN - if (uid == (uid_t)-1) + if (uid == (uid_t) -1) uid = getuid(); - if (gid == (gid_t)-1) + if (gid == (gid_t) -1) gid = getgid(); - (void) fchown(fd, uid, gid); + if (fchown(fd, uid, gid) < 0) + goto fail; #endif #ifdef HAVE_FCHMOD -- cgit