VirtualBox

Changeset 43793 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Nov 2, 2012 9:26:20 AM (12 years ago)
Author:
vboxsync
Message:

VBoxService/vminfo: Check for D-Bus loading on usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r43792 r43793  
    357357#ifdef VBOX_WITH_DBUS
    358358# if defined(RT_OS_LINUX) /* Not yet for Solaris/FreeBSB. */
    359     /* Handle desktop sessions using ConsoleKit. */
    360     VBoxServiceVerbose(4, "Checking ConsoleKit sessions ...\n");
    361 
    362359    DBusError dbErr;
    363     dbus_error_init(&dbErr);
    364 
    365     DBusConnection *pConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbErr);
     360    DBusConnection *pConnection = NULL;
     361    int rc2 = RTDBusLoadLib();
     362    if (RT_SUCCESS(rc2))
     363    {
     364        /* Handle desktop sessions using ConsoleKit. */
     365        VBoxServiceVerbose(4, "Checking ConsoleKit sessions ...\n");
     366
     367        dbus_error_init(&dbErr);
     368        pConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbErr);
     369    }
     370
    366371    if (   pConnection
    367372        && !dbus_error_is_set(&dbErr))
     
    494499        static int s_iBitchedAboutDBus = 0;
    495500        if (s_iBitchedAboutDBus++ < 3)
    496             VBoxServiceError("Unable to connect to system D-Bus (%d/3)\n", s_iBitchedAboutDBus);
     501            VBoxServiceError("Unable to connect to system D-Bus (%d/3): %s\n", s_iBitchedAboutDBus,
     502                             dbus_error_is_set(&dbErr) ? dbErr.message : "D-Bus not installed\n");
    497503    }
    498504
     
    987993#endif /* RT_OS_WINDOWS */
    988994
    989     int rc2;
    990 #ifdef VBOX_WITH_DBUS
    991     rc2 = RTDBusLoadLib();
    992     if (RT_FAILURE(rc2))
    993         VBoxServiceVerbose(0, "VMInfo: D-Bus seems not to be installed; no ConsoleKit session handling available\n");
    994 #endif /* VBOX_WITH_DBUS */
    995 
    996995    /*
    997996     * Write the fixed properties first.
     
    10331032        if (*pfShutdown)
    10341033            break;
    1035         rc2 = RTSemEventMultiWait(g_hVMInfoEvent, g_cMsVMInfoInterval);
     1034        int rc2 = RTSemEventMultiWait(g_hVMInfoEvent, g_cMsVMInfoInterval);
    10361035        if (*pfShutdown)
    10371036            break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette