diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-25 15:04:07 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2019-12-03 19:46:26 +0100 |
commit | 01bd3e12d223aeac1a4b4bfd873fc3cbb0cd0036 (patch) | |
tree | bcb86b623547c2024f5bd4373aaa507ee03253a4 /low-can-binding | |
parent | 386fb28d799f6f1557860c7b31e879eb547d78c2 (diff) |
socketcan-bcm: Fix wrongly opened socket
This commit fixes a problem once a bcm socket has been opened
but the following ioctl failed. Before we still return the socket
number instead of returning a negative value as error.
This resulted in problem because the subscription was considered as valid
and binding was continuing using the closed file descriptor.
Change-Id: Iaa64e7bb00980cb8c0e7080aca238cfb57d628b6
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding')
-rw-r--r-- | low-can-binding/utils/socketcan-bcm.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/low-can-binding/utils/socketcan-bcm.cpp b/low-can-binding/utils/socketcan-bcm.cpp index e992ccbe..515b2fb3 100644 --- a/low-can-binding/utils/socketcan-bcm.cpp +++ b/low-can-binding/utils/socketcan-bcm.cpp @@ -44,6 +44,7 @@ namespace utils { AFB_ERROR("ioctl failed. Error was : %s", strerror(errno)); close(); + return -1; } else { |