Fixing baisc test for s390x machines

This commit is contained in:
František Hrdina 2025-05-26 16:13:39 +02:00
commit ff888df66c

View file

@ -23,7 +23,10 @@ int main() {
}
while ((entry = readdir(dp))) {
if (strncmp(entry->d_name, "ttyS", 4) == 0) {
if (strncmp(entry->d_name, "tty", 3) == 0 &&
strcmp(entry->d_name, "tty") != 0 &&
strcmp(entry->d_name, "tty0") != 0) {
snprintf(device, sizeof(device), "%s%s", DEVICE_PATH, entry->d_name);
break;
}
@ -32,7 +35,7 @@ int main() {
closedir(dp);
if (entry == NULL) {
fprintf(stderr, "No tty device found ttyS*\n");
fprintf(stderr, "No suitable tty device found (excluding tty and tty0)\n");
return 1;
}