~ubuntu-branches/debian/sid/upstart/sid

« back to all changes in this revision

Viewing changes to nih-dbus-tool/tests/expected/test_signal_proxy_function_no_args.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-07-23 00:24:02 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090723002402-pm5tq3kkipr18q00
Tags: 0.6.2-1
* New major upstream release. Closes: #530348
* Remove patches that have been merged upstream or are obsolete
  - debian/patches/01-limits.patch
  - debian/patches/02-telinit-u.patch
  - debian/patches/03-static-convenience-libs.patch
* Add Build-Depends on pkg-config (>= 0.22), libdbus-1-dev (>= 1.2.16) and
  libexpat1-dev (>= 2.0.0). D-Bus has replaced the home-grown IPC.
* Bump Standards-Version to 3.8.2. No further changes.
* debian/copyright
  - Update copyright years.
  - Clarify license text, Upstart is GPL-2 only.
  - Refer to the versioned GPL-2 document.
* Drop upstart-logd package. The logd daemon has been buggy for quite a
  while and thus removed completely upstream.
* debian/upstart.postinst
  - Use "telinit u" to tell init to re-exec itself.
* debian/rules
  - Remove obsolete configure flag.
  - Use dh_install instead of copying the job files around manually.
* Merge the upstart-compat-sysv, startup-tasks and system-services package
  into a single upstart package to avoid any unnecessary diversion between
  the Debian and Ubuntu packaging.
* The location of the job files has changed from /etc/event.d to /etc/init,
  in addition a *.conf suffix is now mandatory.
* Install rc.conf, rc-sysinit.conf, rcS.conf and control-alt-delete.conf as
  provided by upstream.
* debian/conf/*.conf
  - Update tty job files for the new job syntax. Add a description and
    author field.
  - Add dbus-reconnect.conf which tells Upstart to reconnect to the D-Bus
    system bus when runlevel 2345 has been reached.
* Update debian/upstart.install to reflect the changes above.
* Drop debian/upstart.dirs, obsolete.
* debian/README.Debian
  - Sync relevant changes from the latest Ubuntu package.
  - Remove outdated information.
* Add initial support for upstart-job.
  upstart-job is both a virtual package and also small helper utility which
  allows to execute native upstart jobs while preserving the legacy sysv
  "/etc/init.d/<service> <action>" interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DBusHandlerResult
 
2
my_com_netsplit_Nih_Test_Signal_signal (DBusConnection *    connection,
 
3
                                        DBusMessage *       signal,
 
4
                                        NihDBusProxySignal *proxied)
 
5
{
 
6
        DBusMessageIter iter;
 
7
        NihDBusMessage *message;
 
8
 
 
9
        nih_assert (connection != NULL);
 
10
        nih_assert (signal != NULL);
 
11
        nih_assert (proxied != NULL);
 
12
        nih_assert (connection == proxied->proxy->connection);
 
13
 
 
14
        if (! dbus_message_is_signal (signal, proxied->interface->name, proxied->signal->name))
 
15
                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
16
 
 
17
        if (! dbus_message_has_path (signal, proxied->proxy->path))
 
18
                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
19
 
 
20
        if (proxied->proxy->name)
 
21
                if (! dbus_message_has_sender (signal, proxied->proxy->owner))
 
22
                        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
23
 
 
24
        message = nih_dbus_message_new (NULL, connection, signal);
 
25
        if (! message)
 
26
                return DBUS_HANDLER_RESULT_NEED_MEMORY;
 
27
 
 
28
        /* Iterate the arguments to the signal and demarshal into arguments
 
29
         * for our own function call.
 
30
         */
 
31
        dbus_message_iter_init (message->message, &iter);
 
32
 
 
33
        if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INVALID) {
 
34
                nih_free (message);
 
35
                return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
36
        }
 
37
 
 
38
        /* Call the handler function */
 
39
        nih_error_push_context ();
 
40
        ((MySignalHandler)proxied->handler) (proxied->data, message);
 
41
        nih_error_pop_context ();
 
42
        nih_free (message);
 
43
 
 
44
        return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 
45
}