On Friday 18 May 2012 13:17:39 Sergey Senozhatsky wrote:
Hi,
@@ -187,10 +192,17 @@ int read_sysfs(const string &filename, bool
*ok)
*ok = false;
return 0;
}
- file >> i;
+ try
+ {
+ file >> i;
+ if (ok)
+ *ok = true;
+ } catch (std::exception &exc) {
+ if (ok)
+ *ok = "false";
I have changed this to false (without quotes), I guess
that is what you meant.
With that change,
Tested-by: Lekensteyn <lekensteyn(a)gmail.com>
Thanks,
Peter