X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Futils%2Fsocketcan.cpp;h=e8e01980789c005965084dfcffe520af6f96600f;hb=HEAD;hp=f542f4e8b0b4d99ffe5665769fa1cbb767b1d986;hpb=88077fb4b383cf7f35093b6cc0d2d9d86c6f1bf3;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/utils/socketcan.cpp b/low-can-binding/utils/socketcan.cpp index f542f4e8..e8e01980 100644 --- a/low-can-binding/utils/socketcan.cpp +++ b/low-can-binding/utils/socketcan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015, 2016 ,2017 "IoT.bzh" + * Copyright (C) 2015, 2016 , 2017, 2018, 2019 "IoT\.bzh" * Author "Romain Forlot" * Author "Loïc Collignon" * Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,6 +73,9 @@ namespace utils { close(); socket_ = ::socket(domain, type, protocol); + if (socket_ < 0) + AFB_ERROR("Open failed. %s", strerror(errno)); + return socket_; } @@ -117,7 +120,7 @@ namespace utils { if(write_message(vobj[i])<0) { - AFB_ERROR("Error send message %d",i); + AFB_ERROR("Error send message %d", i); return -1; } }