From b5932d1d22d35cef95eb1cffbf489619b264442d Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 6 Jul 2018 21:25:39 +0800 Subject: Random code clean-ups to get ready for the next update. Also tweaked the config a little bit. --- sensors.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sensors.cpp') diff --git a/sensors.cpp b/sensors.cpp index d2166be..615c784 100644 --- a/sensors.cpp +++ b/sensors.cpp @@ -124,16 +124,14 @@ bool SensorBase::init(int id,std::string _sensor_basename) enable_buffer(); devfd=open(devbufpath.c_str(),O_RDONLY); if(!~devfd) - { - LOG('E',"failed to open the iio buffer device: %s",devbufpath.c_str()); - return 1; - } + return LOG('E',"failed to open the iio buffer device: %s",devbufpath.c_str()),1; return 0; } void SensorBase::deinit() { if(~devfd)close(devfd); devfd=-1; + //...also disable iio buffers? } void SensorBase::reset() { -- cgit v1.2.3