Update copyright date
[src/app-framework-binder.git] / src / afb-autoset.c
index b8f8a2e..cdfd280 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
+ * Copyright (C) 2016-2019 "IoT.bzh"
  * Author José Bollo <jose.bollo@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,6 +19,8 @@
 
 #include <stdlib.h>
 #include <stdint.h>
+#include <stdio.h>
+#include <limits.h>
 #include <string.h>
 #include <errno.h>
 #include <sys/types.h>
@@ -113,6 +115,7 @@ static int create_any(const char *path, struct afb_apiset *declare_set, struct a
 {
        int rc;
        struct stat st;
+       char sockname[PATH_MAX + 7];
 
        rc = stat(path, &st);
        if (!rc) {
@@ -121,7 +124,8 @@ static int create_any(const char *path, struct afb_apiset *declare_set, struct a
                        rc = afb_api_so_add_binding(path, declare_set, call_set);
                        break;
                case S_IFSOCK:
-                       rc = afb_api_ws_add_client(path, declare_set, call_set, 0);
+                       snprintf(sockname, sizeof sockname, "unix:%s", path);
+                       rc = afb_api_ws_add_client(sockname, declare_set, call_set, 0);
                        break;
                default:
                        NOTICE("Unexpected autoset entry: %s", path);