Changeset 57642 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Sep 7, 2015 1:05:50 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/HostPowerLinux.cpp
r56845 r57642 23 23 #include <iprt/time.h> 24 24 25 static bool checkDBusError(DBusError *pError, DBusConnection * pConnection)25 static bool checkDBusError(DBusError *pError, DBusConnection **pConnection) 26 26 { 27 27 if (dbus_error_is_set(pError)) … … 29 29 LogRel(("HostPowerServiceLinux: DBus connection Error (%s)\n", pError->message)); 30 30 dbus_error_free(pError); 31 /* Close the socket or whatever underlying the connection. */ 32 dbus_connection_close(pConnection); 33 /* Free in-process resources used for the now-closed connection. */ 34 dbus_connection_unref(pConnection); 31 if (*pConnection) 32 { 33 /* Close the socket or whatever underlying the connection. */ 34 dbus_connection_close(*pConnection); 35 /* Free in-process resources used for the now-closed connection. */ 36 dbus_connection_unref(*pConnection); 37 *pConnection = NULL; 38 } 35 39 return true; 36 40 } … … 59 63 * running as the user anyway" (see session.conf.in in the DBus sources). */ 60 64 mpConnection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error); 61 if (checkDBusError(&error, mpConnection))65 if (checkDBusError(&error, &mpConnection)) 62 66 return; 63 67 /* We do not want to exit(1) if the connection is broken. */ … … 69 73 dbus_bus_add_match(mpConnection, "type='signal',interface='org.freedesktop.UPower'", &error); 70 74 dbus_connection_flush(mpConnection); 71 if (checkDBusError(&error, mpConnection))75 if (checkDBusError(&error, &mpConnection)) 72 76 return; 73 77 /* Create the new worker thread. */
Note:
See TracChangeset
for help on using the changeset viewer.