From 2c9ba498ef4dc663992d410250c9d61791dc7d06 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 22 Feb 2013 13:47:57 +0000 Subject: [PATCH 5/5] temporary: add loginctl direct-sd-uid-get-display --- Makefile.am | 1 + src/login/loginctl.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Makefile.am b/Makefile.am index 62a91aa..989ca83 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3205,6 +3205,7 @@ loginctl_CFLAGS = \ loginctl_LDADD = \ libsystemd-shared.la \ libsystemd-dbus.la \ + libsystemd-login.la \ libudev.la rootbin_PROGRAMS += \ diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 473c77b..1d39d93 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -27,6 +27,7 @@ #include #include +#include "systemd/sd-login.h" #include "log.h" #include "util.h" #include "macro.h" @@ -1594,6 +1595,14 @@ int main(int argc, char*argv[]) { log_parse_environment(); log_open(); + if (argc == 3 && strcmp(argv[1], "direct-sd-uid-get-display") == 0) { + char *d = NULL; + + r = sd_uid_get_display(atoi(argv[2]), &d); + printf("%s\nret %d\n", d, r); + return (r == 0); + } + r = parse_argv(argc, argv); if (r < 0) goto finish; -- 1.7.10.4