From 2f9c6c4146bc905c82bd4c041999dccdf37413d1 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 11 Sep 2013 18:49:47 +0200 Subject: [PATCH] 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 --- src/wayland/weston-launch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wayland/weston-launch.c b/src/wayland/weston-launch.c index 917c42971..79068e0f8 100644 --- a/src/wayland/weston-launch.c +++ b/src/wayland/weston-launch.c @@ -571,6 +571,8 @@ setup_tty(struct weston_launch *wl) free(tty); #ifdef HAVE_SD_SESSION_GET_VT } else if (ok == -ENOENT) { + unsigned vt; + /* Negative errnos are cool, right? So cool that we can't distinguish "session not found" from "key does not exist in the session file"! @@ -578,11 +580,11 @@ setup_tty(struct weston_launch *wl) from sd_pid_get_session()... */ - ok = sd_session_get_vt(session, &tty); + ok = sd_session_get_vt(session, &vt); if (ok < 0) 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); free(tty); #endif