network/ethernet: ioctl returns -1 and stores the error in errno.
Previously, if a device driver returned an error of any kind, -1 was propagated the rest of the way up through the stack instead of the actual error code. Change-Id: I6839763c6b2eb86d6112d3732e6cb80d022f1fe8 Reviewed-on: https://review.haiku-os.org/550 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
77d2c1df0e
commit
e9073260a7
@@ -241,7 +241,9 @@ ethernet_control(net_device *_device, int32 op, void *argument,
|
|||||||
size_t length)
|
size_t length)
|
||||||
{
|
{
|
||||||
ethernet_device *device = (ethernet_device *)_device;
|
ethernet_device *device = (ethernet_device *)_device;
|
||||||
return ioctl(device->fd, op, argument, length);
|
if (ioctl(device->fd, op, argument, length) < 0)
|
||||||
|
return errno;
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user