throw system_error(format("open(%s)", fn));
}
+JsDevice::~JsDevice()
+{
+ sys_close(handle);
+}
+
string JsDevice::get_name() const
{
- char buf[128];
+ char buf[128] = { 0 };
int ret = ioctl(*handle, JSIOCGNAME(sizeof(buf)), buf);
if(ret<0)
throw system_error("ioctl(JSIOCGNAME)");