X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafs-supervisor.c;h=01ffdc8c4a941387fc12fa986aa797ec467e62a1;hb=44c40eaa9c923e070ab628ae759bcc01d9431aec;hp=2afbf53a95a7cd271b10d89eed920c1eab4da76a;hpb=daecef104cd2a6ac3e4436306e96ed48aea8271d;p=src%2Fapp-framework-binder.git diff --git a/src/afs-supervisor.c b/src/afs-supervisor.c index 2afbf53a..01ffdc8c 100644 --- a/src/afs-supervisor.c +++ b/src/afs-supervisor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2019 "IoT.bzh" + * Copyright (C) 2015-2020 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,7 @@ #include #define AFB_BINDING_VERSION 3 +#define AFB_BINDING_NO_ROOT #include #include "afb-cred.h" @@ -237,12 +238,12 @@ static void accept_supervision_link(int sock) */ static void listening(void *closure, uint32_t revents, struct fdev *fdev) { - if ((revents & EPOLLIN) != 0) - accept_supervision_link((int)(intptr_t)closure); - else if ((revents & EPOLLHUP) != 0) { + if ((revents & EPOLLHUP) != 0) { ERROR("supervision socket closed"); exit(1); } + if ((revents & EPOLLIN) != 0) + accept_supervision_link((int)(intptr_t)closure); } /*