import fix

This commit is contained in:
SJ 2016-02-28 21:19:19 +01:00
parent 1d544390d3
commit aefef17404
2 changed files with 9 additions and 11 deletions

View File

@ -13,7 +13,7 @@
#define VERSION "1.2.0-master" #define VERSION "1.2.0-master"
#define BUILD 936 #define BUILD 937
#define HOSTID "mailarchiver" #define HOSTID "mailarchiver"

View File

@ -19,7 +19,7 @@
int import_message(char *filename, struct session_data *sdata, struct __data *data, struct __config *cfg){ int import_message(char *filename, struct session_data *sdata, struct __data *data, struct __config *cfg){
int rc=ERR, fd; int rc=ERR;
char *rule; char *rule;
struct stat st; struct stat st;
struct parser_state state; struct parser_state state;
@ -57,21 +57,19 @@ int import_message(char *filename, struct session_data *sdata, struct __data *da
return rc; return rc;
} }
fd = open(filename, O_RDONLY);
if(fd == -1){
printf("cannot open %s\n", filename);
return rc;
}
close(fd);
snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename); snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename);
sdata->tot_len = st.st_size; sdata->tot_len = st.st_size;
data->import->total_size += st.st_size;
} }
if(sdata->tot_len < 30){
printf("%s is too short: %d bytes\n", sdata->filename, sdata->tot_len);
return rc;
}
data->import->total_size += sdata->tot_len;
sdata->delivered = 0; sdata->delivered = 0;