iio: iio_generic_buffer: Cleanup when receiving signals
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Mon, 23 May 2016 18:39:56 +0000 (21:39 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 29 May 2016 19:37:23 +0000 (20:37 +0100)
commit4f20d5927b8e900ff1c3ee590b700ca71cd3f3ca
treee0ade4f52598f2c8a8f110d7035f4724520b72e7
parent90e9a9500f16e60bf96c95cd6b74f84d56e12ef0
iio: iio_generic_buffer: Cleanup when receiving signals

This will clean (disable buffer/trigger/channels) when doing
something like a CTRL-C. Otherwise restarting generic_buffer requires a
manual echo 0 > buffer/enable

This also cleanup up all the code freeing string buffers at
the end of main. We initialize all pointers to NULL so that cleanup can
all be done under a single error label.

Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
tools/iio/iio_generic_buffer.c