Fix warnings all over citserver; handle function replies; remove unused code.
[citadel.git] / citadel / msgbase.c
index a02f7cd242beb94422e36f3019ec9f452c98f8c9..7eb321905315c9b2313e81cf0639729cb8891ebe 100644 (file)
@@ -1106,6 +1106,10 @@ void mime_download(char *name, char *filename, char *partnum, char *disp,
                        return;
        
                rv = fwrite(content, length, 1, CC->download_fp);
+               if (rv == -1) {
+                       syslog(LOG_EMERG, "mime_download(): Couldn't write: %s\n",
+                              strerror(errno));
+               }
                fflush(CC->download_fp);
                rewind(CC->download_fp);
        
@@ -2068,7 +2072,6 @@ void Dump_RFC822HeadersBody(
        int outlen = 0;
        int nllen = strlen(nl);
        char *mptr;
-       int rc;
 
        mptr = TheMessage->cm_fields['M'];
 
@@ -2128,7 +2131,7 @@ void Dump_RFC822HeadersBody(
                }
        }
        if (outlen > 0) {
-               rc = client_write(outbuf, outlen);
+               client_write(outbuf, outlen);
                outlen = 0;
        }
 }
@@ -2934,7 +2937,6 @@ void serialize_message(struct ser_ret *ret,               /* return values */
 void dump_message(struct CtdlMessage *msg,     /* unserialized msg */
                  long Siz)                     /* how many chars ? */
 {
-       size_t wlen;
        int i;
        static char *forder = FORDER;
        char *buf;
@@ -2949,8 +2951,6 @@ void dump_message(struct CtdlMessage *msg,        /* unserialized msg */
 
        buf = (char*) malloc (Siz + 1);
 
-       wlen = 3;
-       
        for (i=0; i<26; ++i) if (msg->cm_fields[(int)forder[i]] != NULL) {
                        snprintf (buf, Siz, " msg[%c] = %s ...\n", (char) forder[i], 
                                   msg->cm_fields[(int)forder[i]]);
@@ -3308,6 +3308,10 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,      /* message to save */
                        network_fp = fopen(submit_filename, "wb+");
                        if (network_fp != NULL) {
                                rv = fwrite(smr.ser, smr.len, 1, network_fp);
+                               if (rv == -1) {
+                                       syslog(LOG_EMERG, "CtdlSubmitMsg(): Couldn't write network spool file: %s\n",
+                                              strerror(errno));
+                               }
                                fclose(network_fp);
                        }
                        free(smr.ser);
@@ -4968,6 +4972,11 @@ void AdjRefCount(long msgnum, int incr)
        new_arcq.arcq_msgnum = msgnum;
        new_arcq.arcq_delta = incr;
        rv = fwrite(&new_arcq, sizeof(struct arcq), 1, arcfp);
+       if (rv == -1) {
+               syslog(LOG_EMERG, "Couldn't write Refcount Queue File %s: %s\n",
+                      file_arcq,
+                      strerror(errno));
+       }
        fflush(arcfp);
 
        return;