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:
Augustin Cavalier
2018-09-13 04:13:19 +00:00
committed by waddlesplash
parent 77d2c1df0e
commit e9073260a7
@@ -241,7 +241,9 @@ ethernet_control(net_device *_device, int32 op, void *argument,
size_t length)
{
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;
}