* Silenced a few warn_unused_result warnings (ongoing process)
authorArt Cancro <ajc@citadel.org>
Mon, 28 Sep 2009 16:47:05 +0000 (16:47 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 28 Sep 2009 16:47:05 +0000 (16:47 +0000)
citadel/control.c
citadel/user_ops.c

index d0cdf414b6c2b5a5b96ae031ab06afd64fde295d..7cdf65d3bae8939a895529aab81a5564d1033f85 100644 (file)
@@ -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);
        }
 }
index 26bcb0c7205fe596ab5302616f6291bdb0fd94b7..a4bb7eab40f4bb1ada0ac703ea029800298e46f0 100644 (file)
@@ -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)) {