From f96d055e4b38c64123f211f0521f834d649cd01c Mon Sep 17 00:00:00 2001 From: Hartmut Knaack Date: Sun, 31 May 2015 14:39:47 +0200 Subject: [PATCH] tools:iio:lsiio: add closedir before exit In dump_channels() the DIR *dp was left open on exit. Close it and check for errors. Signed-off-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- tools/iio/lsiio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/iio/lsiio.c b/tools/iio/lsiio.c index c585440f864e..65a2385e2a78 100644 --- a/tools/iio/lsiio.c +++ b/tools/iio/lsiio.c @@ -56,7 +56,7 @@ static int dump_channels(const char *dev_dir_name) printf(" %-10s\n", ent->d_name); } - return 0; + return (closedir(dp) == -1) ? -errno : 0; } static int dump_one_device(const char *dev_dir_name) -- 2.30.2