diff options
author | V.Krishn <vkrishn4@gmail.com> | 2019-12-04 17:39:01 +0530 |
---|---|---|
committer | V.Krishn <vkrishn4@gmail.com> | 2019-12-04 17:39:01 +0530 |
commit | da6bcb151f0465d060ac43c27a6cdcfc8e7e3dd5 (patch) | |
tree | d4dc7716fbdc60c50b4f96a60158e0aa59c51d68 | |
parent | 51184a774bb7622f0a5b8fa02140ba7275644840 (diff) | |
download | mqtt-dirpub-da6bcb151f0465d060ac43c27a6cdcfc8e7e3dd5.tar.bz2 |
fix call of _fmask()
-rw-r--r-- | sub_client_output.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sub_client_output.c b/sub_client_output.c index 19ae025..0c4951e 100644 --- a/sub_client_output.c +++ b/sub_client_output.c @@ -621,24 +621,23 @@ static FILE *_mosquitto_fopen(const char *path, const char *mode) void print_message_file(struct mosq_config *cfg, const struct mosquitto_message *message) { - + cfg->fmask_topic = message->topic; FILE *fptr = NULL; - if(cfg->format == NULL && strlen(cfg->fmask) >= 1) { + if(cfg->format && strlen(cfg->fmask) == 0) { + _fmask(cfg->format, cfg, message); /* experimental */ + } else { _fmask(cfg->fmask, cfg, message); } - if(cfg->format && strlen(cfg->fmask) == 0) { /* experimental */ - _fmask(cfg->format, cfg, message); - } char *path, *prog; path = dirname(strdup(cfg->ffmask)); prog = basename(strdup(cfg->ffmask)); - + mkpath(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - + /* reasonable method to distinguish between directory * and a writable node (by default is off) */ if(cfg->nodesuffix) { |