]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
Fix debian init script so it works with systemd.
[citadel.git] / citadel / msgbase.c
index 95909e7cdbc682414a33904520215c34b925cbb0..ddc12aafdba517bfa33030a5873582455138d836 100644 (file)
@@ -3050,7 +3050,7 @@ void flood_protect_quickie_message(const char *from,
                                   const char *subject,
                                   int nCriterions,
                                   const char **CritStr,
-                                  long *CritStrLen,
+                                  const long *CritStrLen,
                                   long ccid,
                                   long ioid,
                                   time_t NOW)
@@ -3088,7 +3088,7 @@ void flood_protect_quickie_message(const char *from,
                                       eUpdate,
                                       ccid,
                                       ioid);
-       if (seenstamp < tsday)
+       if ((seenstamp > 0) && (seenstamp < tsday))
        {
                FreeStrBuf(&guid);
                /* yes, we did. flood protection kicks in. */
@@ -3264,6 +3264,11 @@ eReadState CtdlReadMessageBodyAsync(AsyncIO *IO)
                 IO->SendBuf.fd);
        
        fd = fopen(fn, "a+");
+       if (fd == NULL) {
+               syslog(LOG_EMERG, "failed to open file %s: %s", fn, strerror(errno));
+               cit_backtrace();
+               exit(1);
+       }
 #endif
 
        ReadMsg = IO->ReadMsg;
@@ -3345,7 +3350,7 @@ eReadState CtdlReadMessageBodyAsync(AsyncIO *IO)
        if (MsgFinished)
                return eReadSuccess;
        else 
-               return eAbort;
+               return eReadFail;
 }