Add gitlab issue/merge request templates
[apps/agl-service-can-low-level.git] / low-can-binding / utils / socketcan.cpp
index f542f4e..e8e0198 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015, 2016 ,2017 "IoT.bzh"
+ * Copyright (C) 2015, 2016 , 2017, 2018, 2019 "IoT\.bzh"
  * Author "Romain Forlot" <romain.forlot@iot.bzh>
  * Author "Loïc Collignon" <loic.collignon@iot.bzh>
  * 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;
                        }
                }