X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fafb-hsrv.c;h=1db59cd327a88a52db762c8b1114ef2232fa9e3c;hb=afff776f7e27c8be7610cfbd23c4d1be32699ed9;hp=51502a6443b7ce96491b3d9bc2f9c7380330092d;hpb=22cba30f139a006fadb5fdf521f9c4c5bfbfac4a;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index 51502a64..1db59cd3 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -38,7 +38,7 @@ #include "verbose.h" #include "locale-root.h" -#include "afb-common.h" +#include "afb-systemd.h" #include "jobs.h" #define JSON_CONTENT "application/json" @@ -238,8 +238,8 @@ static void end_handler(void *cls, struct MHD_Connection *connection, void **rec static void do_run(int signum, void *arg) { MHD_UNSIGNED_LONG_LONG to; - struct afb_hsrv *hsrv = arg; + if (!signum) { do { MHD_run(hsrv->httpd); } while(MHD_get_timeout(hsrv->httpd, &to) == MHD_YES && !to); } @@ -420,7 +420,7 @@ int afb_hsrv_start(struct afb_hsrv *hsrv, uint16_t port, unsigned int connection return 0; } - rc = sd_event_add_io(afb_common_get_event_loop(), &evsrc, info->listen_fd, EPOLLIN, io_event_callback, hsrv); + rc = sd_event_add_io(afb_systemd_get_event_loop(), &evsrc, info->listen_fd, EPOLLIN, io_event_callback, hsrv); if (rc < 0) { MHD_stop_daemon(httpd); errno = -rc;