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".
This commit is contained in:
parent
97a01bc9a5
commit
3dcc6e0441
33
hermes.c
33
hermes.c
@ -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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,9 +145,9 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
if (rc < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Can't add address to ack file.");
|
||||
return -1;
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -245,7 +244,7 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
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 @@ hermes_main(char * incoming_mail, const char * listname)
|
||||
/* Archive the article. */
|
||||
|
||||
ArchiveMail(MailStruct, listname);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
13
listserv.c
13
listserv.c
@ -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 @@ listserv_main(char * incoming_mail, char * default_list)
|
||||
|
||||
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 @@ listserv_main(char * incoming_mail, char * default_list)
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Parse the body and call the apropriate routines for each
|
||||
@ -87,7 +86,7 @@ listserv_main(char * incoming_mail, char * default_list)
|
||||
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 @@ listserv_main(char * incoming_mail, char * default_list)
|
||||
((MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From));
|
||||
Indecipherable(MailStruct, default_list);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -191,11 +191,11 @@ int savefile(const char *filename, const char *buffer);
|
||||
|
||||
/********** 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 @@ int DeleteAddress(struct Mail *MailStruct, const char *param1, const char *param
|
||||
|
||||
/********** hermes.c **********/
|
||||
|
||||
int hermes_main(char *incoming_mail, const char *listname);
|
||||
void hermes_main(char *incoming_mail, const char *listname);
|
||||
|
||||
/********** subscribe.c **********/
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user