mutter-launch: adapt to systemd API change

The API was changed during the patch review.

(Yes, we were depending on API which was sitting in a patch not
yet reviewed... you know, vertical integration!)

https://bugzilla.gnome.org/show_bug.cgi?id=707929
This commit is contained in:
Giovanni Campagna 2013-09-11 18:49:47 +02:00 committed by Giovanni Campagna
parent 72ca2b218d
commit 2f9c6c4146

View File

@ -571,6 +571,8 @@ setup_tty(struct weston_launch *wl)
free(tty); free(tty);
#ifdef HAVE_SD_SESSION_GET_VT #ifdef HAVE_SD_SESSION_GET_VT
} else if (ok == -ENOENT) { } else if (ok == -ENOENT) {
unsigned vt;
/* Negative errnos are cool, right? /* Negative errnos are cool, right?
So cool that we can't distinguish "session not found" So cool that we can't distinguish "session not found"
from "key does not exist in the session file"! from "key does not exist in the session file"!
@ -578,11 +580,11 @@ setup_tty(struct weston_launch *wl)
from sd_pid_get_session()... from sd_pid_get_session()...
*/ */
ok = sd_session_get_vt(session, &tty); ok = sd_session_get_vt(session, &vt);
if (ok < 0) if (ok < 0)
error(1, -ok, "could not determine current TTY"); error(1, -ok, "could not determine current TTY");
snprintf(path, PATH_MAX, "/dev/tty%s", tty); snprintf(path, PATH_MAX, "/dev/tty%u", vt);
wl->tty = open(path, O_RDWR | O_NOCTTY | O_CLOEXEC); wl->tty = open(path, O_RDWR | O_NOCTTY | O_CLOEXEC);
free(tty); free(tty);
#endif #endif