ipc/dbus/RawDBusConnection.cpp
author David Anderson <danderson@mozilla.com>
Mon, 14 May 2012 12:10:12 -0700
changeset 95264 50177d59c0e173e03d93ef7a3b67a704f1a1cb34
parent 94790 7a8607523522bfe8576614273bd8967469d60db1
child 97132 5f9bf688b9ac88ec8ff5fbcee441e323070575ae
permissions -rw-r--r--
Merge from mozilla-central.

/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=40: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "RawDBusConnection.h"
#include <dbus/dbus.h>

using namespace mozilla::ipc;

RawDBusConnection::RawDBusConnection() {
}

RawDBusConnection::~RawDBusConnection() {
}

bool RawDBusConnection::Create() {
  DBusError err;
  dbus_error_init(&err);
  mConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
  if (dbus_error_is_set(&err)) {
    dbus_error_free(&err);
    return false;
  }
  dbus_connection_set_exit_on_disconnect(mConnection, FALSE);
  return true;
}