Skip to content

Commit

Permalink
Drop py_user_proc from the users systemd version
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Planas <aplanas@suse.com>
  • Loading branch information
aplanas committed Oct 24, 2023
1 parent 27c4880 commit a9b9472
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions psutil/arch/linux/users.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ psutil_users_systemd(PyObject *self, PyObject *args) {
PyObject *py_username = NULL;
PyObject *py_tty = NULL;
PyObject *py_hostname = NULL;
PyObject *py_user_proc = NULL;
double tstamp = 0.0;
pid_t pid = 0;
int sessions;
Expand All @@ -86,8 +85,6 @@ psutil_users_systemd(PyObject *self, PyObject *args) {
for (int i = 0; i < sessions; i++) {
session_id = sessions_list[i];
py_tuple = NULL;
py_user_proc = NULL;
py_user_proc = Py_True;

username = NULL;
if (sd_session_get_username(session_id, &username) < 0)
Expand Down Expand Up @@ -125,12 +122,11 @@ psutil_users_systemd(PyObject *self, PyObject *args) {
goto error;

py_tuple = Py_BuildValue(
"OOOdO" _Py_PARSE_PID,
"OOOd" _Py_PARSE_PID,
py_username, // username
py_tty, // tty
py_hostname, // hostname
tstamp, // tstamp
py_user_proc, // (bool) user process
pid // process id
);
if (! py_tuple)
Expand Down

0 comments on commit a9b9472

Please sign in to comment.