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

This commit is contained in:
Jakob Bornecrantz committed 2019-10-04 10:32:02 +01:00
1 parent 979536dd4b
commit f2fcfd98e1
1 file changed
+1 -1
+1 -1
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;