Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Allow to remove systemd library
[src/app-framework-binder.git]
/
src
/
afb-export.c
diff --git
a/src/afb-export.c
b/src/afb-export.c
index
8ebe8e0
..
202a73f
100644
(file)
--- a/
src/afb-export.c
+++ b/
src/afb-export.c
@@
-50,7
+50,9
@@
#include "afb-xreq.h"
#include "afb-calls.h"
#include "afb-xreq.h"
#include "afb-calls.h"
+#if WITH_SYSTEMD
#include "systemd.h"
#include "systemd.h"
+#endif
#include "jobs.h"
#include "verbose.h"
#include "globset.h"
#include "jobs.h"
#include "verbose.h"
#include "globset.h"
@@
-312,20
+314,35
@@
static int event_broadcast_cb(struct afb_api_x3 *closure, const char *name, stru
static struct sd_event *get_event_loop(struct afb_api_x3 *closure)
{
static struct sd_event *get_event_loop(struct afb_api_x3 *closure)
{
+#if WITH_SYSTEMD
jobs_acquire_event_manager();
return systemd_get_event_loop();
jobs_acquire_event_manager();
return systemd_get_event_loop();
+#else
+ errno = ENOTSUP;
+ return NULL;
+#endif
}
static struct sd_bus *get_user_bus(struct afb_api_x3 *closure)
{
}
static struct sd_bus *get_user_bus(struct afb_api_x3 *closure)
{
+#if WITH_SYSTEMD
jobs_acquire_event_manager();
return systemd_get_user_bus();
jobs_acquire_event_manager();
return systemd_get_user_bus();
+#else
+ errno = ENOTSUP;
+ return NULL;
+#endif
}
static struct sd_bus *get_system_bus(struct afb_api_x3 *closure)
{
}
static struct sd_bus *get_system_bus(struct afb_api_x3 *closure)
{
+#if WITH_SYSTEMD
jobs_acquire_event_manager();
return systemd_get_system_bus();
jobs_acquire_event_manager();
return systemd_get_system_bus();
+#else
+ errno = ENOTSUP;
+ return NULL;
+#endif
}
static int rootdir_open_locale_cb(struct afb_api_x3 *closure, const char *filename, int flags, const char *locale)
}
static int rootdir_open_locale_cb(struct afb_api_x3 *closure, const char *filename, int flags, const char *locale)
@@
-481,7
+498,6
@@
static struct sd_event *hooked_get_event_loop(struct afb_api_x3 *closure)
struct afb_export *export = from_api_x3(closure);
struct sd_event *r;
struct afb_export *export = from_api_x3(closure);
struct sd_event *r;
- jobs_acquire_event_manager();
r = get_event_loop(closure);
return afb_hook_api_get_event_loop(export, r);
}
r = get_event_loop(closure);
return afb_hook_api_get_event_loop(export, r);
}
@@
-491,7
+507,6
@@
static struct sd_bus *hooked_get_user_bus(struct afb_api_x3 *closure)
struct afb_export *export = from_api_x3(closure);
struct sd_bus *r;
struct afb_export *export = from_api_x3(closure);
struct sd_bus *r;
- jobs_acquire_event_manager();
r = get_user_bus(closure);
return afb_hook_api_get_user_bus(export, r);
}
r = get_user_bus(closure);
return afb_hook_api_get_user_bus(export, r);
}
@@
-501,7
+516,6
@@
static struct sd_bus *hooked_get_system_bus(struct afb_api_x3 *closure)
struct afb_export *export = from_api_x3(closure);
struct sd_bus *r;
struct afb_export *export = from_api_x3(closure);
struct sd_bus *r;
- jobs_acquire_event_manager();
r = get_system_bus(closure);
return afb_hook_api_get_system_bus(export, r);
}
r = get_system_bus(closure);
return afb_hook_api_get_system_bus(export, r);
}