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 <waddlesplash@gmail.com>
(cherry picked from commit e9073260a7054be876ec67bfefbfdaba05ea3142)
Reviewed-on: https://review.haiku-os.org/554
Diff
src/add-ons/kernel/network/devices/ethernet/ethernet.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -241,7 +241,9 @@
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;
}