[systemd-commits] src/login

Lennart Poettering lennart at kemper.freedesktop.org
Tue Jan 3 12:50:15 PST 2012


 src/login/logind.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 976c088a0242a1a91b8f00899a4c2ae0e621a185
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jan 3 21:50:02 2012 +0100

    logind: don't watch vcsa if nobody cares

diff --git a/src/login/logind.c b/src/login/logind.c
index 3a1903c..333d5f8 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -955,7 +955,8 @@ static int manager_connect_udev(Manager *m) {
         ev.events = EPOLLIN;
         ev.data.u32 = FD_SEAT_UDEV;
 
-        if (m->n_autovts <= 0)
+        /* Don't bother watching VCSA devices, if nobody cares */
+        if (m->n_autovts <= 0 || m->console_active_fd < 0)
                 return 0;
 
         if (epoll_ctl(m->epoll_fd, EPOLL_CTL_ADD, m->udev_seat_fd, &ev) < 0)
@@ -1074,13 +1075,13 @@ int manager_startup(Manager *m) {
         if (m->epoll_fd < 0)
                 return -errno;
 
-        /* Connect to udev */
-        r = manager_connect_udev(m);
+        /* Connect to console */
+        r = manager_connect_console(m);
         if (r < 0)
                 return r;
 
-        /* Connect to console */
-        r = manager_connect_console(m);
+        /* Connect to udev */
+        r = manager_connect_udev(m);
         if (r < 0)
                 return r;
 



More information about the systemd-commits mailing list