blob: 1e27f1a1c790c847812d93f738e12ce83b3be677 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh
set -e
exec 2>&1
set -x
cd "$ADTTMP"
cat > connect.c <<EOF
#include <stdio.h>
#include <dbus/dbus.h>
int main (void)
{
DBusError error;
DBusConnection *connection;
dbus_error_init(&error);
connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
if (connection == NULL) {
fprintf(stderr, "%s: %s", error.name, error.message);
dbus_error_free(&error);
return 1;
}
dbus_connection_unref(connection);
return 0;
}
EOF
gcc -o connect connect.c $(pkg-config --cflags --libs dbus-1)
test -x connect
dbus-run-session -- ./connect
echo "everything seems OK"
|