Skip to content

Commit

Permalink
fixed missing log messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
baallan committed Aug 31, 2017
1 parent e31aec6 commit 3bb2045
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ldms/src/store/store_flatfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,17 @@ open_store(struct ldmsd_store *s, const char *container, const char *schema,
ms = calloc(1, sizeof(*ms));
sprintf(tmp_path, "%s/%s", si->path, name);
ms->path = strdup(tmp_path);
if (!ms->path)
if (!ms->path) {
msglog(LDMSD_LERROR, "Out of memory at %s:%d\n",
__FILE__, __LINE__);
goto err4;
}
ms->file = fopen_perm(ms->path, "a+", LDMSD_DEFAULT_FILE_PERM);
if (!ms->file) {
/* log message needed here from errno */
int eno = errno;
msglog(LDMSD_LERROR, "Error opening %s: %d: %s at %s:%d\n",
ms->path, eno, strerror(eno),
__FILE__, __LINE__);
goto err4;
}
pthread_mutex_init(&ms->lock, NULL);
Expand Down

0 comments on commit 3bb2045

Please sign in to comment.