From 33fadc946c46dbf5a6b3c94a0e048e735040c3b1 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 23 Nov 2023 11:32:57 +0100 Subject: [PATCH] iiod: Fix handling of error code for init_usb_daemon() The init_usb_daemon() returns a valid error code directly, which does not have to be retrieved from the errno variable. Signed-off-by: Paul Cercueil --- iiod/iiod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiod/iiod.c b/iiod/iiod.c index 79fdf2002..618a189ce 100644 --- a/iiod/iiod.c +++ b/iiod/iiod.c @@ -564,7 +564,7 @@ int main(int argc, char **argv) if (WITH_IIOD_USBD && ffs_mountpoint) { ret = init_usb_daemon(ffs_mountpoint, nb_pipes); if (ret < 0) { - iio_strerror(errno, err_str, sizeof(err_str)); + iio_strerror(-ret, err_str, sizeof(err_str)); IIO_ERROR("Unable to init USB: %s\n", err_str); thread_pool_destroy(main_thread_pool);