~ubuntu-branches/ubuntu/oneiric/libphone-ui/oneiric

« back to all changes in this revision

Viewing changes to src/dbus.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Reichel
  • Date: 2010-06-08 09:23:30 UTC
  • Revision ID: james.westby@ubuntu.com-20100608092330-a9tpkbf3sn2y5ceo
Tags: upstream-0.1+git20100517
ImportĀ upstreamĀ versionĀ 0.1+git20100517

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include <dbus/dbus-glib.h>
 
3
#include "dbus.h"
 
4
 
 
5
static DBusGConnection *_bus = NULL;
 
6
 
 
7
DBusGConnection *_dbus()
 
8
{
 
9
        GError *error = NULL;
 
10
        if (!_bus) {
 
11
                _bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
 
12
                if (error) {
 
13
                        g_critical("Failed to get on the bus: (%d) %s",
 
14
                                   error->code, error->message);
 
15
                        g_error_free(error);
 
16
                        return NULL;
 
17
                }
 
18
        }
 
19
        return _bus;
 
20
}