1
0
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:
Peter Hutterer
2015-08-21 09:17:24 +10:00
parent 7f2d060ff9
commit 35b5fa975e
2 changed files with 4 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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;
}