[-]
[+]
|
Changed |
_service:tar_git:bluebinder.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:bluebinder.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:bluebinder-1.0.12.tar.bz2/Makefile
^
|
@@ -1,9 +1,16 @@
# TODO: this is a bit minimalistic isn't it?
+USE_SYSTEMD ?= 1
+
+DEPEND_LIBS = libgbinder glib-2.0
+ifeq ($(USE_SYSTEMD),1)
+DEPEND_LIBS += libsystemd
+endif
+
build: bluebinder
bluebinder: bluebinder.c
- gcc $(CFLAGS) -Wall -flto $^ `pkg-config --cflags --libs libgbinder glib-2.0 libsystemd` -o $@
+ gcc $(CFLAGS) -Wall -flto $^ `pkg-config --cflags --libs $(DEPEND_LIBS)` -DUSE_SYSTEMD=$(USE_SYSTEMD) -o $@
install:
mkdir -p $(DESTDIR)/usr/sbin
|
[-]
[+]
|
Changed |
_service:tar_git:bluebinder-1.0.12.tar.bz2/bluebinder.c
^
|
@@ -39,7 +39,9 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
+#if USE_SYSTEMD
#include <systemd/sd-daemon.h>
+#endif
#include <gbinder.h>
@@ -406,7 +408,9 @@
if (binder_init_complete(proxy)) {
proxy->init_failed = FALSE;
+#if USE_SYSTEMD
sd_notify(0, "READY=1");
+#endif
*status = GBINDER_STATUS_OK;
return gbinder_local_reply_append_int32(gbinder_local_object_new_reply(obj), 0);
} else {
@@ -416,7 +420,7 @@
}
} else if (code == 2 || code == 3 || code == 4) {
- unsigned int count, elemsize;
+ gsize count, elemsize;
GBinderReader reader;
const uint8_t *vec;
uint8_t *packet;
@@ -574,9 +578,11 @@
close(proxy.host_fd);
+#if USE_SYSTEMD
sd_notify(0,
"STATUS=Exiting.\n"
"ERRNO=19");
+#endif
return err;
}
|