Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: centos8 memory fix #31

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions src/log_proxy_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GOptionEntry *change_options()
int number_of_options = sizeof(entries) / sizeof(entries[0]);
// we remove 2 options and we add 3 new
GOptionEntry *res = g_malloc(sizeof(GOptionEntry) * (number_of_options + 1));
for (int i = 0 ; i < number_of_options ; i++) {
for (int i = 0 ; i < number_of_options - 1; i++) {
if (g_strcmp0(entries[i].long_name, "fifo") == 0) {
continue;
}
Expand All @@ -33,9 +33,10 @@ GOptionEntry *change_options()
}
res[i] = entries[i];
}
res[number_of_options - 2] = new_entry1;
res[number_of_options - 1] = new_entry2;
res[number_of_options] = new_entry3;
res[number_of_options - 3] = new_entry1;
res[number_of_options - 2] = new_entry2;
res[number_of_options - 1] = new_entry3;
res[number_of_options] = entries[number_of_options - 1];
return res;
}

Expand Down
3 changes: 2 additions & 1 deletion src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ static GOptionEntry entries[] = {
{ "chgrp", 'g', 0, G_OPTION_ARG_STRING, &chgrp_str, "if set, try (if you don't have sufficient privileges, it will fail silently) to change the group of the logfile to the given group value", NULL },
{ "use-locks", 'm', 0, G_OPTION_ARG_NONE, &use_locks, "use locks to append to main log file (useful if several process writes to the same file)", NULL },
{ "fifo", 'f', 0, G_OPTION_ARG_STRING, &fifo, "if set, read lines on this fifo instead of stdin", NULL },
{ "rm-fifo-at-exit", 'r', 0, G_OPTION_ARG_NONE, &rm_fifo_at_exit, "if set, drop fifo at then end of the program (you have to use --fifo option of course)", NULL }
{ "rm-fifo-at-exit", 'r', 0, G_OPTION_ARG_NONE, &rm_fifo_at_exit, "if set, drop fifo at then end of the program (you have to use --fifo option of course)", NULL },
{ NULL }
};

#endif /* OPTIONS_H_ */