piler.c fixes

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2020-08-08 21:27:54 +02:00
parent 7ce0f42e7b
commit 8a5e01c5c5

View File

@ -106,7 +106,6 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
char tmpbuf[SMALLBUFSIZE]; char tmpbuf[SMALLBUFSIZE];
char *status=S_STATUS_UNDEF; char *status=S_STATUS_UNDEF;
char *arule; char *arule;
char *rcpt;
char *p; char *p;
struct timezone tz; struct timezone tz;
struct timeval tv1, tv2; struct timeval tv1, tv2;
@ -135,7 +134,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
post_parse(sdata, &parser_state, cfg); post_parse(sdata, &parser_state, cfg);
if(cfg->syslog_recipients == 1){ if(cfg->syslog_recipients == 1){
rcpt = parser_state.b_to; char *rcpt = parser_state.b_to;
do { do {
rcpt = split_str(rcpt, " ", tmpbuf, sizeof(tmpbuf)-1); rcpt = split_str(rcpt, " ", tmpbuf, sizeof(tmpbuf)-1);
@ -162,10 +161,11 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
syslog(LOG_PRIORITY, "%s: invalid message, hdr_len: %d", filename, sdata->hdr_len); syslog(LOG_PRIORITY, "%s: invalid message, hdr_len: %d", filename, sdata->hdr_len);
rc = ERR; rc = ERR;
} }
else {
rc = process_message(sdata, &parser_state, data, cfg); rc = process_message(sdata, &parser_state, data, cfg);
unlink(parser_state.message_id_hash); unlink(parser_state.message_id_hash);
} }
}
unlink(sdata->tmpframe); unlink(sdata->tmpframe);
@ -467,7 +467,7 @@ void initialise_configuration(){
int main(int argc, char **argv){ int main(int argc, char **argv){
int i, daemonise=0, dedupfd; int i, daemonise=0;
struct stat st; struct stat st;
@ -521,7 +521,7 @@ int main(int argc, char **argv){
if(stat(cfg.pidfile, &st) == 0) fatal(ERR_PID_FILE_EXISTS); if(stat(cfg.pidfile, &st) == 0) fatal(ERR_PID_FILE_EXISTS);
if(cfg.mmap_dedup_test == 1){ if(cfg.mmap_dedup_test == 1){
dedupfd = open(MESSAGE_ID_DEDUP_FILE, O_RDWR); int dedupfd = open(MESSAGE_ID_DEDUP_FILE, O_RDWR);
if(dedupfd == -1) fatal(ERR_OPEN_DEDUP_FILE); if(dedupfd == -1) fatal(ERR_OPEN_DEDUP_FILE);
data.dedup = mmap(NULL, MAXCHILDREN*DIGEST_LENGTH*2, PROT_READ|PROT_WRITE, MAP_SHARED, dedupfd, 0); data.dedup = mmap(NULL, MAXCHILDREN*DIGEST_LENGTH*2, PROT_READ|PROT_WRITE, MAP_SHARED, dedupfd, 0);