From 1afa6efb264a6b2587d0f084b67de7addf4801f3 Mon Sep 17 00:00:00 2001 From: Holger Dengler Date: Mon, 2 Mar 2026 11:30:33 +0100 Subject: [PATCH] lszcrypt: Change exit code to 0 for empty device list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An empty device list is not an error case, if `lszcrypt` is called without a specific device list or device filter. Return with rc == 0 in such cases. Remove the message about the empty device list on stderr. Reviewed-by: Jan Höppner Reviewed-by: Harald Freudenberger Reviewed-by: Ingo Franzki Signed-off-by: Holger Dengler Signed-off-by: Jan Höppner --- zconf/zcrypt/lszcrypt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/zconf/zcrypt/lszcrypt.c b/zconf/zcrypt/lszcrypt.c index 27451857..cac1cbfa 100644 --- a/zconf/zcrypt/lszcrypt.c +++ b/zconf/zcrypt/lszcrypt.c @@ -955,8 +955,6 @@ static void show_devices_all(void) /* Scan the devices */ path = util_path_sysfs("devices/ap/"); count = util_scandir(&dev_vec, alphasort, path, "card[0-9a-fA-F]+"); - if (count < 1) - errx(EXIT_FAILURE, "No crypto card devices found."); util_rec_print_hdr(rec); for (i = 0; i < count; i++) show_device(rec, dev_vec[i]->d_name);