mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 13:14:14 +08:00
hciconfig: Fix errno handling convention
Variables which are assigned to the errno variable (usually called "err") should be negative, and "-err" should be used where a positive value is needed.
This commit is contained in:
parent
100527bd5a
commit
382c867b09
@ -210,9 +210,9 @@ static void cmd_le_addr(int ctl, int hdev, char *opt)
|
||||
|
||||
dd = hci_open_dev(hdev);
|
||||
if (dd < 0) {
|
||||
err = errno;
|
||||
err = -errno;
|
||||
fprintf(stderr, "Could not open device: %s(%d)\n",
|
||||
strerror(err), err);
|
||||
strerror(-err), -err);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -230,9 +230,9 @@ static void cmd_le_addr(int ctl, int hdev, char *opt)
|
||||
|
||||
ret = hci_send_req(dd, &rq, 1000);
|
||||
if (status || ret < 0) {
|
||||
err = errno;
|
||||
err = -errno;
|
||||
fprintf(stderr, "Can't set random address for hci%d: "
|
||||
"%s (%d)\n", hdev, strerror(err), err);
|
||||
"%s (%d)\n", hdev, strerror(-err), -err);
|
||||
}
|
||||
|
||||
hci_close_dev(dd);
|
||||
|
Loading…
Reference in New Issue
Block a user