VirtualBox

Ignore:
Timestamp:
May 4, 2015 2:23:38 PM (10 years ago)
Author:
vboxsync
Message:

Main/HostPowerLinux: nicer code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/linux/HostPowerLinux.cpp

    r55602 r55647  
    9999        DBusMessage *pMessage = NULL;
    100100
    101         do {
     101        for (;;)
     102        {
    102103            DBusMessageIter args;
    103104            dbus_bool_t fSuspend;
     
    105106            pMessage = dbus_connection_pop_message(pPowerObj->mpConnection);
    106107            if (pMessage == NULL)
    107                 continue;
     108                break;
    108109            /* The systemd-logind interface notification. */
    109110            if (   dbus_message_is_signal(pMessage, "org.freedesktop.login1.Manager", "PrepareForSleep")
     
    117118                    pPowerObj->notify(Reason_HostSuspend);
    118119                else
    119                     pPowerObj->notify(Reason_HostResume);           
     120                    pPowerObj->notify(Reason_HostResume);
    120121            }
    121122            /* The UPowerd interface notifications.  Sleeping is the older one,
     
    130131            /* Free local resources held for the message. */
    131132            dbus_message_unref(pMessage);
    132         } while (pMessage != NULL);
     133        }
    133134    }
    134135    /* Close the socket or whatever underlying the connection. */
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