forked from drath/libratbag
hidpp: Log the errno including strerror
Signed-off-by:Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -82,7 +82,7 @@ static int hidpp10_write_command(struct ratbag_device *device, __u8 *cmd, int si
|
||||
return 0;
|
||||
|
||||
if (res < 0)
|
||||
log_error(device->ratbag, "Error: %d\n", -res);
|
||||
log_error(device->ratbag, "Error: %s (%d)\n", strerror(-res), -res);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ int hidpp10_request_command(struct ratbag_device *device, union hidpp10_message
|
||||
} while (ret > 0);
|
||||
|
||||
if (ret < 0) {
|
||||
log_error(ratbag, " USB error: %d\n", -ret);
|
||||
log_error(ratbag, " USB error: %s (%d)\n", strerror(-ret), -ret);
|
||||
perror("write");
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ hidpp20_write_command(struct ratbag_device *device, uint8_t *cmd, int size)
|
||||
return 0;
|
||||
|
||||
if (res < 0)
|
||||
log_error(device->ratbag, "Error: %d\n", -res);
|
||||
log_error(device->ratbag, "Error: %s (%d)\n", strerror(-res), -res);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ hidpp20_request_command(struct ratbag_device *device, union hidpp20_message *msg
|
||||
} while (ret > 0);
|
||||
|
||||
if (ret < 0) {
|
||||
log_error(ratbag, " USB error: %d\n", -ret);
|
||||
log_error(ratbag, " USB error: %s (%d)\n", strerror(-ret), -ret);
|
||||
perror("write");
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user