X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafs-supervisor.c;fp=src%2Fafs-supervisor.c;h=1e92b9f3424dabc964b204f6e77d251d2d5bafea;hb=ca820c65c2b03a24e8936218171c6c1d138fd1f7;hp=be0cdbf5d33b437997f809cf74c998acd334d770;hpb=f15ea770dd9b13a20331853a026091316984f9ca;p=src%2Fapp-framework-binder.git diff --git a/src/afs-supervisor.c b/src/afs-supervisor.c index be0cdbf5..1e92b9f3 100644 --- a/src/afs-supervisor.c +++ b/src/afs-supervisor.c @@ -45,6 +45,7 @@ #include "afb-api-so-v2.h" #include "afb-api-ws.h" #include "afb-apiset.h" +#include "afb-fdev.h" #include "jobs.h" #include "verbose.h" #include "wrap-json.h" @@ -193,13 +194,20 @@ static void on_supervised_hangup(struct afb_stub_ws *stub) static int make_supervised(int fd, struct afb_cred *cred) { struct supervised *s; + struct fdev *fdev; s = malloc(sizeof *s); if (!s) return -1; + fdev = afb_fdev_create(fd); + if (!fdev) { + free(s); + return -1; + } + s->cred = cred; - s->stub = afb_stub_ws_create_client(fd, supervision_apiname, empty_apiset); + s->stub = afb_stub_ws_create_client(fdev, supervision_apiname, empty_apiset); if (!s->stub) { free(s); return -1;