Use new iohook_open_nul_fd() API

Makes error handling more consistent
This commit is contained in:
Tau
2019-11-03 11:02:54 -05:00
parent 7ee74214f7
commit 879dc0bfb4
6 changed files with 52 additions and 8 deletions

View File

@ -85,7 +85,11 @@ HRESULT ds_hook_init(const struct ds_config *cfg)
return hr;
}
ds_fd = iohook_open_dummy_fd();
hr = iohook_open_nul_fd(&ds_fd);
if (FAILED(hr)) {
return hr;
}
return S_OK;
}

View File

@ -89,7 +89,12 @@ HRESULT gpio_hook_init(const struct gpio_config *cfg)
memcpy(&gpio_config, cfg, sizeof(*cfg));
gpio_fd = iohook_open_dummy_fd();
hr = iohook_open_nul_fd(&gpio_fd);
if (FAILED(hr)) {
return hr;
}
hr = iohook_push_handler(gpio_handle_irp);
if (FAILED(hr)) {

View File

@ -50,7 +50,12 @@ HRESULT jvs_hook_init(const struct jvs_config *cfg)
return S_FALSE;
}
jvs_fd = iohook_open_dummy_fd();
hr = iohook_open_nul_fd(&jvs_fd);
if (FAILED(hr)) {
return hr;
}
hr = iohook_push_handler(jvs_handle_irp);
if (FAILED(hr)) {