Improved proccess renaming
This commit is contained in:
parent
a6a9a647b2
commit
563a2453ba
18
src/gajim.py
18
src/gajim.py
|
@ -159,13 +159,17 @@ else:
|
||||||
from music_track_listener import MusicTrackListener
|
from music_track_listener import MusicTrackListener
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
if os.name == 'posix': # dl module is Unix Only
|
from ctypes import CDLL
|
||||||
try: # rename the process name to gajim
|
from ctypes.util import find_library
|
||||||
import dl
|
import platform
|
||||||
libc = dl.open('/lib/libc.so.6')
|
|
||||||
libc.call('prctl', 15, 'gajim\0', 0, 0, 0)
|
sysname = platform.system()
|
||||||
except Exception:
|
libc = CDLL(find_library('c'))
|
||||||
pass
|
|
||||||
|
if sysname == 'Linux':
|
||||||
|
libc.prctl(15, 'Gajim', 0, 0, 0)
|
||||||
|
elif sysname in ('FreeBSD', 'OpenBSD', 'NetBSD'):
|
||||||
|
libc.setproctitle('Gajim')
|
||||||
|
|
||||||
if gtk.pygtk_version < (2, 12, 0):
|
if gtk.pygtk_version < (2, 12, 0):
|
||||||
pritext = _('Gajim needs PyGTK 2.12 or above')
|
pritext = _('Gajim needs PyGTK 2.12 or above')
|
||||||
|
|
Loading…
Reference in New Issue