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
nit
  • Loading branch information
corona10 committed Nov 12, 2022
commit 69ac18a8e583c1874b389228c51c857a3ad0c318
10 changes: 8 additions & 2 deletions Modules/syslogmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,12 @@ syslog_closelog_impl(PyObject *module)
_syslog_state *state = get_syslog_state(module);
if (state->S_log_open) {
closelog();
Py_CLEAR(state->S_ident_o);
state->S_log_open = 0;
}

if (state->S_ident_o != NULL) {
Py_CLEAR(state->S_ident_o);
}
Py_RETURN_NONE;
}

Expand Down Expand Up @@ -397,9 +400,12 @@ _syslog_clear(PyObject *module)
_syslog_state *state = get_syslog_state(module);
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;
}

if (state->S_ident_o != NULL) {
Py_CLEAR(state->S_ident_o);
}
Comment thread
corona10 marked this conversation as resolved.
Outdated
return 0;
}

Expand Down