Fixes to RabbitMQ filter and consumer.

This commit is contained in:
Markus Makela
2015-01-30 18:03:20 +02:00
parent 5d6b805d6e
commit ab6418c939
6 changed files with 15 additions and 16 deletions

View File

@ -337,6 +337,7 @@ int main(int argc, char** argv)
MYSQL db_inst;
char ch, *cnfname = NULL, *cnfpath = NULL;
static const char* fname = "consumer.cnf";
const char* default_path = "@CMAKE_INSTALL_PREFIX@/etc";
if((c_inst = calloc(1,sizeof(CONSUMER))) == NULL){
fprintf(stderr, "Fatal Error: Cannot allocate enough memory.\n");
@ -359,6 +360,12 @@ int main(int argc, char** argv)
}
}
if(cnfpath == NULL)
{
cnfpath = strdup(default_path);
cnfnlen = strlen(default_path);
}
cnfname = calloc(cnfnlen + strlen(fname) + 1,sizeof(char));
if(cnfpath){