Fallback to other methods if the device name in sysfs is not printable.

Change-Id: I20b22950399d4a515d2688b955248a3de3c61d05
Этот коммит содержится в:
Bill(Shuzhou) Liu
2023-02-08 09:48:58 -06:00
коммит произвёл Shuzhou Liu
родитель 02141a7f1d
Коммит 00a6c78a51
+2 -1
Просмотреть файл
@@ -45,6 +45,7 @@
#include <errno.h>
#include <sys/utsname.h>
#include <pthread.h>
#include <ctype.h>
#include <string>
#include <unistd.h>
#include <poll.h>
@@ -1935,7 +1936,7 @@ rsmi_dev_name_get(uint32_t dv_ind, char *name, size_t len) {
ret = get_dev_name_from_file(dv_ind, name, len);
if (ret || name[0] == '\0') {
if (ret || name[0] == '\0' || !isprint(name[0]) ) {
ret = get_dev_name_from_id(dv_ind, name, len, NAME_STR_DEVICE);
}