From 322953f1b1f00cd3e644e195b14c816eedbada12 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 28 Sep 2009 16:47:05 +0000 Subject: [PATCH] * Silenced a few warn_unused_result warnings (ongoing process) --- citadel/control.c | 26 +++++++++++--------------- citadel/user_ops.c | 7 ++++--- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/citadel/control.c b/citadel/control.c index d0cdf414b..7cdf65d3b 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -150,6 +150,7 @@ void control_find_user (struct ctdluser *EachUser, void *out_data) void get_control(void) { static int already_have_control = 0; + int rv = 0; /* * If we already have the control record in memory, there's no point @@ -166,35 +167,30 @@ void get_control(void) control_fp = fopen(file_citadel_control, "rb+"); if (control_fp != NULL) { lock_control(); - fchown(fileno(control_fp), config.c_ctdluid, -1); - fchmod(fileno(control_fp), - S_IRUSR|S_IWUSR); + rv = fchown(fileno(control_fp), config.c_ctdluid, -1); + rv = fchmod(fileno(control_fp), S_IRUSR|S_IWUSR); } } if (control_fp == NULL) { control_fp = fopen(file_citadel_control, "wb+"); if (control_fp != NULL) { lock_control(); - fchown(fileno(control_fp), config.c_ctdluid, -1); - fchmod(fileno(control_fp), - S_IRUSR|S_IWUSR); + rv = fchown(fileno(control_fp), config.c_ctdluid, -1); + rv = fchmod(fileno(control_fp), S_IRUSR|S_IWUSR); memset(&CitControl, 0, sizeof(struct CitControl)); - fwrite(&CitControl, sizeof(struct CitControl), - 1, control_fp); + rv = fwrite(&CitControl, sizeof(struct CitControl), 1, control_fp); rewind(control_fp); } } if (control_fp == NULL) { - CtdlLogPrintf(CTDL_ALERT, "ERROR opening %s: %s\n", - file_citadel_control, - strerror(errno)); + CtdlLogPrintf(CTDL_ALERT, "ERROR opening %s: %s\n", file_citadel_control, strerror(errno)); return; } rewind(control_fp); - fread(&CitControl, sizeof(struct CitControl), 1, control_fp); + rv = fread(&CitControl, sizeof(struct CitControl), 1, control_fp); already_have_control = 1; - chown(file_citadel_control, config.c_ctdluid, (-1)); + rv = chown(file_citadel_control, config.c_ctdluid, (-1)); } @@ -203,11 +199,11 @@ void get_control(void) */ void put_control(void) { + int rv = 0; if (control_fp != NULL) { rewind(control_fp); - fwrite(&CitControl, sizeof(struct CitControl), 1, - control_fp); + rv = fwrite(&CitControl, sizeof(struct CitControl), 1, control_fp); fflush(control_fp); } } diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 26bcb0c72..a4bb7eab4 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -772,6 +772,7 @@ void logout(void) static int validpw(uid_t uid, const char *pass) { char buf[256]; + int rv = 0; if (IsEmptyStr(pass)) { CtdlLogPrintf(CTDL_DEBUG, "refusing to check empty password for uid=%d using chkpwd...\n", uid); @@ -781,9 +782,9 @@ static int validpw(uid_t uid, const char *pass) CtdlLogPrintf(CTDL_DEBUG, "Validating password for uid=%d using chkpwd...\n", uid); begin_critical_section(S_CHKPWD); - write(chkpwd_write_pipe[1], &uid, sizeof(uid_t)); - write(chkpwd_write_pipe[1], pass, 256); - read(chkpwd_read_pipe[0], buf, 4); + rv = write(chkpwd_write_pipe[1], &uid, sizeof(uid_t)); + rv = write(chkpwd_write_pipe[1], pass, 256); + rv = read(chkpwd_read_pipe[0], buf, 4); end_critical_section(S_CHKPWD); if (!strncmp(buf, "PASS", 4)) { -- 2.30.2