~mterry/lightdm/root-tests

« back to all changes in this revision

Viewing changes to src/session-child.c

  • Committer: Robert Ancell
  • Date: 2012-07-23 05:28:25 UTC
  • Revision ID: robert.ancell@canonical.com-20120723052825-u9e0lxplbk4umqdv
Set utmp ut_host field to the X display address

Show diffs side-by-side

added added

removed removed

Lines of Context:
540
540
            strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
541
541
            strncpy (ut.ut_id, xdisplay, sizeof (ut.ut_id));
542
542
            strncpy (ut.ut_user, username, sizeof (ut.ut_user));
543
 
            if (remote_host_name)
 
543
            if (xdisplay)
 
544
                strncpy (ut.ut_host, xdisplay, sizeof (ut.ut_host));
 
545
            else if (remote_host_name)
544
546
                strncpy (ut.ut_host, remote_host_name, sizeof (ut.ut_host));
545
547
            gettimeofday (&tv, NULL);
546
548
            ut.ut_tv.tv_sec = tv.tv_sec;
567
569
            strncpy (ut.ut_line, tty + strlen ("/dev/"), sizeof (ut.ut_line));
568
570
            strncpy (ut.ut_id, xdisplay, sizeof (ut.ut_id));
569
571
            strncpy (ut.ut_user, username, sizeof (ut.ut_user));
570
 
            if (remote_host_name)
 
572
            if (xdisplay)
 
573
                strncpy (ut.ut_host, xdisplay, sizeof (ut.ut_host));
 
574
            else if (remote_host_name)
571
575
                strncpy (ut.ut_host, remote_host_name, sizeof (ut.ut_host));
572
576
            gettimeofday (&tv, NULL);
573
577
            ut.ut_tv.tv_sec = tv.tv_sec;