From ff888df66c3198be7c7e88c57cc5d656844effd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Hrdina?= Date: Mon, 26 May 2025 16:13:39 +0200 Subject: [PATCH] Fixing baisc test for s390x machines --- Sanity/basic/test_lockdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sanity/basic/test_lockdev.c b/Sanity/basic/test_lockdev.c index 72ec1f8..80d3225 100644 --- a/Sanity/basic/test_lockdev.c +++ b/Sanity/basic/test_lockdev.c @@ -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; }