OSSP CVS Repository

ossp - Check-in [354]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 354
Date: 2001-Jan-20 15:29:28 (local)
2001-Jan-20 14:29:28 (UTC)
User:simons
Branch:
Comment: Since we never tested the return codes of *_main() anyway, don't pretend we do: Made listsern_main(), hermes_main() and approve_main() officially return "void".
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/hermes.c      1.17 -> 1.18     16 inserted, 19 deleted
ossp-pkg/petidomo/listserv.c      1.6 -> 1.7     6 inserted, 9 deleted
ossp-pkg/petidomo/petidomo.h      1.19 -> 1.20     4 inserted, 4 deleted

ossp-pkg/petidomo/hermes.c 1.17 -> 1.18

--- hermes.c     2001/01/20 13:52:41     1.17
+++ hermes.c     2001/01/20 14:29:28     1.18
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/hermes.c,v $
-   $Revision: 1.17 $
+   $Revision: 1.18 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -24,8 +24,7 @@
 #include "libtext/text.h"
 #include "petidomo.h"
 
-int
-hermes_main(char * incoming_mail, const char * listname)
+void hermes_main(char * incoming_mail, const char * listname)
     {
     const struct PD_Config *     MasterConfig;
     const struct List_Config *   ListConfig;
@@ -63,17 +62,17 @@
     if (MailStruct->Envelope == NULL)
         {
         syslog(LOG_ERR, "Received mail without a valid envelope.");
-        return 0;
+        return;
         }
     if (MailStruct->From == NULL)
         {
         syslog(LOG_ERR, "Received mail without From: line.");
-        return 0;
+        return;
         }
     if (*MailStruct->Body == '\0')
         {
         syslog(LOG_INFO, "Received mail with empty body.");
-        return 0;
+        return;
         }
 
     /* Initialize internal stuff. */
@@ -116,7 +115,7 @@
             case 0:
                 break;
             case 1:
-                return 0;
+                return;
             }
         }
 
@@ -146,9 +145,9 @@
             else
                 {
                 syslog(LOG_ERR, "Failed to send email to \"%s\" concerning this request.", owner);
-                return -1;
+                exit(-1);
                 }
-            return 0;
+            return;
             }
 
         else if (ListConfig->listtype == LIST_CLOSED)
@@ -178,9 +177,9 @@
                 else
                     {
                     syslog(LOG_ERR, "Failed to send email to \"%s\" concerning this request.", owner);
-                    return -1;
+                    exit(-1);
                     }
-                return 0;
+                return;
                 }
             }
 
@@ -215,9 +214,9 @@
             else
                 {
                 syslog(LOG_ERR, "Failed to send email to \"%s\" concerning this request.", owner);
-                return -1;
+                exit(-1);
                 }
-            return 0;
+            return;
             }
 
         else if (ListConfig->listtype == LIST_ACKED_ONCE)
@@ -233,7 +232,7 @@
                 if (rc < 0)
                     {
                     syslog(LOG_ERR, "Can't add address to ack file.");
-                    return -1;
+                    exit(-1);
                     }
                 }
             else
@@ -245,7 +244,7 @@
                 if (rc < 0)
                     {
                     syslog(LOG_ERR, "Can't verify whether address \"%s\" needs to be acknowledged or not.", MailStruct->From);
-                    return -1;
+                    exit(-1);
                     }
                 else if (rc == 0)
                     {
@@ -276,9 +275,9 @@
                     else
                         {
                         syslog(LOG_ERR, "Failed to send email to \"%s\" concerning this request.", owner);
-                        return -1;
+                        exit(-1);
                         }
-                    return 0;
+                    return;
                     }
                 else
                     syslog(LOG_NOTICE, "\"%s\" tried to post to ack-once list \"%s\" and has been found in " \
@@ -429,6 +428,4 @@
     /* Archive the article. */
 
     ArchiveMail(MailStruct, listname);
-
-    return 0;
     }


ossp-pkg/petidomo/listserv.c 1.6 -> 1.7

--- listserv.c   2001/01/18 20:30:50     1.6
+++ listserv.c   2001/01/20 14:29:28     1.7
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/listserv.c,v $
-   $Revision: 1.6 $
+   $Revision: 1.7 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -25,8 +25,7 @@
 
 char * g_currLine;              /* pointer to the line currently parsed */
 
-int
-listserv_main(char * incoming_mail, char * default_list)
+void listserv_main(char * incoming_mail, char * default_list)
 {
     const struct List_Config * ListConfig;
     struct Mail *   MailStruct;
@@ -56,11 +55,11 @@
 
     if (MailStruct->Envelope == NULL) {
         syslog(LOG_NOTICE, "Received mail without a valid envelope.");
-        return 0;
+        return;
     }
     if (MailStruct->From == NULL) {
         syslog(LOG_NOTICE, "Received mail without From: line.");
-        return 0;
+        return;
     }
 
     /* Do access control. */
@@ -77,7 +76,7 @@
       case 0:
           break;
       case 1:
-          return 0;
+          return;
     }
 
     /* Parse the body and call the apropriate routines for each
@@ -87,7 +86,7 @@
     if (*g_currLine == '\0') {
         syslog(LOG_NOTICE, "Received mail with empty body.");
         SendHelp(MailStruct, NULL, NULL, default_list);
-        return 0;
+        return;
     }
     for (nextLine = text_find_next_line(g_currLine), junklines = 0, found = 0;
          *g_currLine != '\0' && junklines <= 7;
@@ -147,6 +146,4 @@
             ((MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From));
         Indecipherable(MailStruct, default_list);
     }
-
-    return 0;
 }


ossp-pkg/petidomo/petidomo.h 1.19 -> 1.20

--- petidomo.h   2001/01/20 13:52:41     1.19
+++ petidomo.h   2001/01/20 14:29:28     1.20
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/petidomo.h,v $
-   $Revision: 1.19 $
+   $Revision: 1.20 $
 
    Copyright (C) 2000 by CyberSolutions GmbH, Germany.
 
@@ -191,11 +191,11 @@
 
 /********** listserv.c **********/
 
-int listserv_main(char *incoming_mail, char *default_list);
+void listserv_main(char *incoming_mail, char *default_list);
 
 /********** approve.c **********/
 
-int approve_main(char *incoming_mail);
+void approve_main(char *incoming_mail);
 
 /********** mailer.c **********/
 
@@ -225,7 +225,7 @@
 
 /********** hermes.c **********/
 
-int hermes_main(char *incoming_mail, const char *listname);
+void hermes_main(char *incoming_mail, const char *listname);
 
 /********** subscribe.c **********/
 

CVSTrac 2.0.1