diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2018-04-01 16:05:06 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2018-04-01 16:49:23 +0300 |
commit | 967f7a403f313fb45062bb9336869a16f3ed2a01 (patch) | |
tree | 269d01b2b33f06be8884ed73b616ac901fbb2e24 | |
parent | cfbb14fecee7e19a4f36abef527abd45fafca591 (diff) |
correctly set process name. Fixes #9034
-rw-r--r-- | gajim/gajim.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gajim/gajim.py b/gajim/gajim.py index 87d81f651..a7026323d 100644 --- a/gajim/gajim.py +++ b/gajim/gajim.py @@ -218,7 +218,7 @@ class GajimApplication(Gtk.Application): if Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL: i18n.direction_mark = '\u200F' - from ctypes import CDLL + from ctypes import CDLL, byref, create_string_buffer from ctypes.util import find_library import platform @@ -231,7 +231,10 @@ class GajimApplication(Gtk.Application): PR_SET_NAME = 15 if sysname == 'Linux': - libc.prctl(PR_SET_NAME, 'gajim') + proc_name = b'gajim' + buff = create_string_buffer(len(proc_name)+1) + buff.value = proc_name + libc.prctl(PR_SET_NAME, byref(buff), 0, 0, 0) elif sysname in ('FreeBSD', 'OpenBSD', 'NetBSD'): libc.setproctitle('gajim') |