afb-hsrv: Adds an error when alias dir doesn't exist
[src/app-framework-binder.git] / src / afb-hsrv.c
index 4577948..56509c3 100644 (file)
@@ -359,14 +359,14 @@ int afb_hsrv_add_alias_root(struct afb_hsrv *hsrv, const char *prefix, struct lo
        return 0;
 }
 
-int afb_hsrv_add_alias(struct afb_hsrv *hsrv, const char *prefix, const char *alias, int priority, int relax)
+int afb_hsrv_add_alias(struct afb_hsrv *hsrv, const char *prefix, int dirfd, const char *alias, int priority, int relax)
 {
        struct locale_root *root;
        int rc;
 
-       root = locale_root_create(AT_FDCWD, alias);
+       root = locale_root_create_at(dirfd, alias);
        if (root == NULL) {
-               /* TODO message */
+               ERROR("can't connect to directory %s: %m", alias);
                rc = 0;
        } else {
                rc = afb_hsrv_add_alias_root(hsrv, prefix, root, priority, relax);