aux/os: Return 'errno' on device open failure

This commit is contained in:
Jakob Bornecrantz 2019-10-04 10:23:46 +01:00
parent 979536dd4b
commit f2fcfd98e1

View file

@ -122,7 +122,7 @@ os_hid_open_hidraw(const char *path, struct os_hid_device **out_hid)
hrdev->fd = open(path, O_RDWR);
if (hrdev->fd < 0) {
free(hrdev);
return -1;
return -errno;
}
*out_hid = &hrdev->base;