X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-api-dbus.c;h=1f254d1608d6636f377be7f468f7c1a01dfcdab4;hb=9cf1fcea338281f76eaac000930479b18dacef01;hp=8c55ed016a472a4e8d4bba2f4a620b597b733e40;hpb=d7e4faba5d1744160d538edd74bc4bdd8a173b1a;p=src%2Fapp-framework-binder.git diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index 8c55ed01..1f254d16 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -15,7 +15,7 @@ * limitations under the License. */ -#if defined(WITH_DBUS_TRANSPARENCY) +#if WITH_DBUS_TRANSPARENCY #define _GNU_SOURCE @@ -45,6 +45,7 @@ #include "verbose.h" #include "systemd.h" +#include "jobs.h" static const char DEFAULT_PATH_PREFIX[] = "/org/agl/afb/api/"; @@ -129,6 +130,7 @@ static struct api_dbus *make_api_dbus_3(int system, const char *path, size_t pat } /* choose the bus */ + jobs_acquire_event_manager(); sdbus = (system ? systemd_get_system_bus : systemd_get_user_bus)(); if (sdbus == NULL) goto error2; @@ -664,7 +666,7 @@ struct origin struct afb_cred *cred; /* the origin */ - char name[1]; + char name[]; }; /* get the credentials for the message */ @@ -708,7 +710,7 @@ static struct origin *afb_api_dbus_server_origin_get(struct api_dbus *api, const } /* not found, create it */ - origin = malloc(strlen(sender) + sizeof *origin); + origin = malloc(strlen(sender) + 1 + sizeof *origin); if (origin == NULL) errno = ENOMEM; else {