~ubuntu-branches/ubuntu/oneiric/bluez/oneiric-proposed

« back to all changes in this revision

Viewing changes to test/agent.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2011-07-28 16:47:35 UTC
  • mfrom: (1.1.34 upstream) (6.3.15 sid)
  • Revision ID: james.westby@ubuntu.com-20110728164735-f34luwrarv52mhlq
Tags: 4.95-0ubuntu1
* New upstream release.
* Resynchronize with Debian unstable, remaining changes:
  - debian/source_bluez.py, debian/bluez.install:
    + apport hook made by Baptiste Mille-Mathias.
  - debian/rules: don't use simple-patchsys.
  - debian/source/format: use source format 3.0.
  - debian/patches/pkg-config-install-paths.patch: install bluez-alsa plugin
    to the multiarch path, now that alsa-lib has transitioned.
* debian/patches/02_disable_hal.patch: refreshed.
* debian/patches/pkg-config-install-paths.patch: refreshed.
* debian/control, debian/rules: run autoreconf when building as required by
  pkg-config-install-paths.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
static volatile sig_atomic_t __io_canceled = 0;
43
43
static volatile sig_atomic_t __io_terminated = 0;
 
44
static volatile sig_atomic_t exit_on_release = 1;
44
45
 
45
46
static void sig_term(int sig)
46
47
{
286
287
        if (!__io_canceled)
287
288
                fprintf(stderr, "Agent has been released\n");
288
289
 
289
 
        __io_terminated = 1;
 
290
        if (exit_on_release)
 
291
                __io_terminated = 1;
290
292
 
291
293
        reply = dbus_message_new_method_return(msg);
292
294
        if (!reply) {
414
416
        return 0;
415
417
}
416
418
 
 
419
static void create_paired_device_reply(DBusPendingCall *pending,
 
420
                                                        void *user_data)
 
421
{
 
422
        __io_terminated = 1;
 
423
        return;
 
424
}
 
425
 
417
426
static int create_paired_device(DBusConnection *conn, const char *adapter_path,
418
427
                                                const char *agent_path,
419
428
                                                const char *capabilities,
421
430
{
422
431
        dbus_bool_t success;
423
432
        DBusMessage *msg;
 
433
        DBusPendingCall *pending;
424
434
 
425
435
        msg = dbus_message_new_method_call("org.bluez", adapter_path,
426
436
                                                "org.bluez.Adapter",
435
445
                                        DBUS_TYPE_STRING, &capabilities,
436
446
                                        DBUS_TYPE_INVALID);
437
447
 
438
 
        success = dbus_connection_send(conn, msg, NULL);
 
448
        exit_on_release = 0;
 
449
        success = dbus_connection_send_with_reply(conn, msg, &pending, -1);
 
450
        if (pending)
 
451
                dbus_pending_call_set_notify(pending,
 
452
                                                create_paired_device_reply,
 
453
                                                NULL, NULL);
439
454
 
440
455
        dbus_message_unref(msg);
441
456