Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address code review
  • Loading branch information
corona10 committed Nov 12, 2022
commit 8beb461586fd6cd0e96bccb05368a8ede5ae9f47
7 changes: 5 additions & 2 deletions Modules/syslogmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,11 @@ static int
_syslog_clear(PyObject *module)
{
_syslog_state *state = get_syslog_state(module);
Py_CLEAR(state->S_ident_o);
state->S_log_open = 0;
if (state->S_log_open) {
closelog();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What happens if interpreter A calls closelog() and interpreter B (same process!) still uses the Python syslog module, so after closelog() has been called?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

POSIX syslog will transparently call openlog() with default values.

Py_CLEAR(state->S_ident_o);
state->S_log_open = 0;
}
return 0;
}

Expand Down