diff options
author | Tony Asleson <tasleson@redhat.com> | 2023-03-30 10:10:23 -0500 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2023-03-30 11:04:49 -0500 |
commit | 300c8209a810f287992376e8a0561fdf878d1520 (patch) | |
tree | a6dc54756cefa0c87d85beb5bb3c34f206e8d563 /daemons | |
parent | f7ca470abe995210e8008084c0b4436292b2816b (diff) | |
download | lvm2-300c8209a810f287992376e8a0561fdf878d1520.tar.gz |
lvmdbusd: Correct seg. fault on s390x ELN
syscall 186 is specific to x86 64bit. As this is different from arch
to arch and between same arch different arch size we will only grab
thread ID using built-in python support if it is supported.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2166931
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/lvmdbusd/utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py index fdd7578c1..27b869c13 100644 --- a/daemons/lvmdbusd/utils.py +++ b/daemons/lvmdbusd/utils.py @@ -11,7 +11,6 @@ import xml.etree.ElementTree as Et import sys import inspect import collections -import ctypes import errno import fcntl import os @@ -305,8 +304,16 @@ class DebugMessages(object): self.queue.clear() +def _get_tid(): + try: + # Only 3.8 and later have this + return threading.get_native_id() + except: + return -1 + + def _format_log_entry(msg): - tid = ctypes.CDLL('libc.so.6').syscall(186) + tid = _get_tid() if not cfg.systemd and STDOUT_TTY: msg = "%s: %d:%d - %s" % \ |