From 4b32de5907f39c084e817c59ee2619e1fd1af6cf Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 4 Jun 2021 16:17:18 +0100 Subject: [PATCH] local: local_buffer_enabled_set() does not set errno This function returns the error code directly and does not set errno. Signed-off-by: Paul Cercueil --- local.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/local.c b/local.c index 08fa1576f..8a072537e 100644 --- a/local.c +++ b/local.c @@ -1039,8 +1039,7 @@ static int local_close(const struct iio_device *dev) ret1 = local_buffer_enabled_set(dev, false); if (ret1) { - ret1 = -errno; - iio_strerror(errno, err_str, sizeof(err_str)); + iio_strerror(-ret1, err_str, sizeof(err_str)); IIO_ERROR("Error during buffer disable: %s\n", err_str); if (ret == 0) ret = ret1;