fix all PIFile::readAll calls

This commit is contained in:
2025-09-05 21:50:35 +03:00
parent 3d7ba1dee6
commit c05b8b4095
2 changed files with 9 additions and 9 deletions

View File

@@ -1208,7 +1208,7 @@ PIVector<PISerial::DeviceInfo> PISerial::availableDevicesInfo(bool test) {
# endif
PIFile file_prefixes("/proc/tty/drivers", PIIODevice::ReadOnly);
if (file_prefixes.open()) {
PIString fc = PIString::fromAscii(file_prefixes.readAll(true)), line, cpref;
PIString fc = PIString::fromAscii(file_prefixes.readAll()), line, cpref;
PIStringList words;
file_prefixes.close();
while (!fc.isEmpty()) {
@@ -1235,8 +1235,8 @@ PIVector<PISerial::DeviceInfo> PISerial::availableDevicesInfo(bool test) {
for (const auto & e: de) { // TODO changes in FileInfo
for (const auto & p: prefixes) {
if (e.name().startsWith(p)) {
di = DeviceInfo();
di.path = e.path;
di = DeviceInfo();
di.path = e.path;
# ifdef LINUX
ssize_t lsz = readlink(("/sys/class/tty/" + e.name()).dataAscii(), linkbuf, 1024);
if (lsz > 0) {