aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-05-31 08:39:47 -0400
committerJonathan Cameron <jic23@kernel.org>2015-05-31 12:30:29 -0400
commitf96d055e4b38c64123f211f0521f834d649cd01c (patch)
tree19156f7b90c46d5a96e1edc3c665888b9d170986
parent121b5e505fe86ea52603c946865d658a5fe8130b (diff)
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 <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--tools/iio/lsiio.c2
1 files changed, 1 insertions, 1 deletions
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)
56 printf(" %-10s\n", ent->d_name); 56 printf(" %-10s\n", ent->d_name);
57 } 57 }
58 58
59 return 0; 59 return (closedir(dp) == -1) ? -errno : 0;
60} 60}
61 61
62static int dump_one_device(const char *dev_dir_name) 62static int dump_one_device(const char *dev_dir_name)