1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

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
This commit is contained in:
Tony Asleson 2023-03-30 10:10:23 -05:00
parent f7ca470abe
commit 300c8209a8

View File

@ -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" % \