Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tools/logger/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ static void *wait_open(const char *watched_dir, const char *expected_file)

char * const fpath = malloc(strlen(watched_dir) + 1 + strlen(expected_file) + 1);

if (!fpath) {
fprintf(stderr, "error: can't allocate memory\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more specific error message would not hurt but it's never going to get printed anyway so who cares

exit(EXIT_FAILURE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exit(EXIT_FAILURE);
abort();

I think this tends to print more information.

}

strcpy(fpath, watched_dir);
strcat(fpath, "/");
strcat(fpath, expected_file);
Expand Down