summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-11-11 21:57:40 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-11-11 21:57:40 +0100
commit666cf81bd916aa14a9c363ab4933472b1622ad20 (patch)
tree487c2df2cc942d1f3605f14d88baebc0bd32a7e6
parent159cb8c55254048c797816b0bc6a7f26b84146ac (diff)
downloadpsutil-666cf81bd916aa14a9c363ab4933472b1622ad20.tar.gz
fix #1169: (Linux) users() hostname returns username instead
-rw-r--r--CREDITS4
-rw-r--r--HISTORY.rst2
-rw-r--r--psutil/_psutil_linux.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/CREDITS b/CREDITS
index 890b8223..ff242998 100644
--- a/CREDITS
+++ b/CREDITS
@@ -511,3 +511,7 @@ I: 1159, 1160, 1161
N: Matthew Long
W: https://github.com/matray
I: 1167
+
+N: janderbrain
+W: https://github.com/janderbrain
+I: 1169
diff --git a/HISTORY.rst b/HISTORY.rst
index e0f79080..d14253e2 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -7,6 +7,8 @@
**Bug fixes**
+- 1169_: [Linux] users() "hostname" returns username instead. (patch by
+ janderbrain)
- 1172_: [Windows] `make test` does not work.
5.4.1
diff --git a/psutil/_psutil_linux.c b/psutil/_psutil_linux.c
index 2391a67a..6232fe50 100644
--- a/psutil/_psutil_linux.c
+++ b/psutil/_psutil_linux.c
@@ -479,7 +479,7 @@ psutil_users(PyObject *self, PyObject *args) {
"(OOOfOi)",
py_username, // username
py_tty, // tty
- py_username, // hostname
+ py_hostname, // hostname
(float)ut->ut_tv.tv_sec, // tstamp
py_user_proc, // (bool) user process
ut->ut_pid // process id