From bd2b781bcb710e9262a749128d65d285995c0f74 Mon Sep 17 00:00:00 2001 From: Zak Estrada Date: Tue, 10 Sep 2024 14:31:31 -0400 Subject: [PATCH] get_file_name returns a python string, some cleanup --- panda/python/core/pandare/panda.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/python/core/pandare/panda.py b/panda/python/core/pandare/panda.py index dbdcd2174a4..37a6cab78a5 100644 --- a/panda/python/core/pandare/panda.py +++ b/panda/python/core/pandare/panda.py @@ -1707,7 +1707,7 @@ def get_os_family(self): family_num = self.libpanda.panda_os_familyno family_name = self.ffi.string(self.ffi.cast("PandaOsFamily", family_num)) return family_name - + def get_file_name(self, cpu, fd): ''' Get the name of a file from a file descriptor. @@ -1725,7 +1725,7 @@ def get_file_name(self, cpu, fd): return None if fname_ptr == self.ffi.NULL: return None - return self.ffi.string(fname_ptr) + return self.ffi.string(fname_ptr).decode('utf8', 'ignore') def get_current_process(self, cpu): ''' @@ -1849,7 +1849,7 @@ def get_process_name(self, cpu): return None procname = self.ffi.string(proc.name).decode('utf8', 'ignore') - return self.ffi.string(proc.name).decode('utf8', 'ignore') + return procname ################## PYPERIPHERAL FUNCTIONS #####################