chiark / gitweb /
Revert "log_error() if inotify_add_watch() fails"
[elogind.git] / src / login / sd-login.c
index 45e3bb8dcd07c03451f106d235bfe8ee96f64b45..b81dddf86ba79d36259fd544476ca754ff3c2e8f 100644 (file)
@@ -196,7 +196,7 @@ _public_ int sd_uid_is_on_seat(uid_t uid, int require_active, const char *seat)
         }
 
         FOREACH_WORD(w, l, s, state) {
-                if (strncmp(t, w, l) == 0) {
+                if (strneq(t, w, l)) {
                         free(s);
                         free(t);
 
@@ -409,6 +409,10 @@ _public_ int sd_session_get_seat(const char *session, char **seat) {
         return session_get_string(session, "SEAT", seat);
 }
 
+_public_ int sd_session_get_tty(const char *session, char **tty) {
+        return session_get_string(session, "TTY", tty);
+}
+
 _public_ int sd_session_get_service(const char *session, char **service) {
         return session_get_string(session, "SERVICE", service);
 }