diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2011-03-19 13:59:15 +0100 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2011-03-20 11:22:28 +0000 |
commit | 33a88fbfdee773b1473cb5339540d79809363bdc (patch) | |
tree | 8123ae137fdf7ea6839d94fc10b26cb184adcb39 /src/pulsecore | |
parent | d7ce59de88eda4eb638f977975374359254731f7 (diff) |
Get rid of some warnings: -Wunused-result
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]
Diffstat (limited to 'src/pulsecore')
-rw-r--r-- | src/pulsecore/authkey.c | 5 | ||||
-rw-r--r-- | src/pulsecore/core-util.c | 7 |
2 files changed, 8 insertions, 4 deletions
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)); 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 |