mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
Merge pull request #15459 from keszybz/remove-seat_can_multi_session
Remove seat_can_multi_session
This commit is contained in:
commit
75dff0f910
@ -665,10 +665,7 @@ manpages = [
|
||||
'HAVE_PAM'],
|
||||
['sd_seat_get_active',
|
||||
'3',
|
||||
['sd_seat_can_graphical',
|
||||
'sd_seat_can_multi_session',
|
||||
'sd_seat_can_tty',
|
||||
'sd_seat_get_sessions'],
|
||||
['sd_seat_can_graphical', 'sd_seat_can_tty', 'sd_seat_get_sessions'],
|
||||
'HAVE_PAM'],
|
||||
['sd_session_is_active',
|
||||
'3',
|
||||
|
@ -19,7 +19,6 @@
|
||||
<refnamediv>
|
||||
<refname>sd_seat_get_active</refname>
|
||||
<refname>sd_seat_get_sessions</refname>
|
||||
<refname>sd_seat_can_multi_session</refname>
|
||||
<refname>sd_seat_can_tty</refname>
|
||||
<refname>sd_seat_can_graphical</refname>
|
||||
<refpurpose>Determine state of a specific seat</refpurpose>
|
||||
@ -44,11 +43,6 @@
|
||||
<paramdef>unsigned int *<parameter>n_uids</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
||||
<funcprototype>
|
||||
<funcdef>int <function>sd_seat_can_multi_session</function></funcdef>
|
||||
<paramdef>const char *<parameter>seat</parameter></paramdef>
|
||||
</funcprototype>
|
||||
|
||||
<funcprototype>
|
||||
<funcdef>int <function>sd_seat_can_tty</function></funcdef>
|
||||
<paramdef>const char *<parameter>seat</parameter></paramdef>
|
||||
@ -90,11 +84,6 @@
|
||||
<constant>NULL</constant> may be returned and should be considered
|
||||
equivalent to an empty array.</para>
|
||||
|
||||
<para><function>sd_seat_can_multi_session()</function> may be used
|
||||
to determine whether a specific seat is capable of multi-session,
|
||||
i.e. allows multiple login sessions in parallel (with only one
|
||||
being active at a time).</para>
|
||||
|
||||
<para><function>sd_seat_can_tty()</function> may be used to
|
||||
determine whether a specific seat provides TTY functionality, i.e.
|
||||
is useful as a text console.</para>
|
||||
@ -114,7 +103,7 @@
|
||||
|
||||
<para> On success, <function>sd_seat_get_active()</function> returns 0 or a positive integer. On success,
|
||||
<function>sd_seat_get_sessions()</function> returns the number of entries in the session identifier
|
||||
array. If the test succeeds, <function>sd_seat_can_multi_session</function>,
|
||||
array. If the test succeeds,
|
||||
<function>sd_seat_can_tty</function> and <function>sd_seat_can_graphical</function> return a positive
|
||||
integer, if it fails 0. On failure, these calls return a negative errno-style error code.</para>
|
||||
|
||||
@ -157,6 +146,14 @@
|
||||
|
||||
<xi:include href="libsystemd-pkgconfig.xml" />
|
||||
|
||||
<refsect1>
|
||||
<title>History</title>
|
||||
|
||||
<para>In the past, <function>sd_seat_can_multi_session()</function> was used to check whether the seat
|
||||
supports multiple sessions. All seats support that now, so that function has been deprecated and always
|
||||
returns true.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
|
||||
|
@ -746,7 +746,7 @@ static int seat_get_can(const char *seat, const char *variable) {
|
||||
}
|
||||
|
||||
_public_ int sd_seat_can_multi_session(const char *seat) {
|
||||
return seat_get_can(seat, "CAN_MULTI_SESSION");
|
||||
return true;
|
||||
}
|
||||
|
||||
_public_ int sd_seat_can_tty(const char *seat) {
|
||||
|
@ -142,8 +142,11 @@ static void test_login(void) {
|
||||
|
||||
log_info("sd_session_get_seat(\"%s\") → \"%s\"", session, seat);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
r = sd_seat_can_multi_session(seat);
|
||||
assert_se(r >= 0);
|
||||
#pragma GCC diagnostic pop
|
||||
assert_se(r == 1);
|
||||
log_info("sd_session_can_multi_seat(\"%s\") → %s", seat, yes_no(r));
|
||||
|
||||
r = sd_seat_can_tty(seat);
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static BUS_DEFINE_PROPERTY_GET(property_get_can_multi_session, "b", Seat, seat_can_multi_session);
|
||||
static BUS_DEFINE_PROPERTY_GET_GLOBAL(property_get_const_true, "b", true);
|
||||
static BUS_DEFINE_PROPERTY_GET(property_get_can_tty, "b", Seat, seat_can_tty);
|
||||
static BUS_DEFINE_PROPERTY_GET(property_get_can_graphical, "b", Seat, seat_can_graphical);
|
||||
|
||||
@ -296,7 +296,7 @@ const sd_bus_vtable seat_vtable[] = {
|
||||
|
||||
SD_BUS_PROPERTY("Id", "s", NULL, offsetof(Seat, id), SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("ActiveSession", "(so)", property_get_active_session, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
|
||||
SD_BUS_PROPERTY("CanMultiSession", "b", property_get_can_multi_session, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("CanMultiSession", "b", property_get_const_true, 0, SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN),
|
||||
SD_BUS_PROPERTY("CanTTY", "b", property_get_can_tty, 0, SD_BUS_VTABLE_PROPERTY_CONST),
|
||||
SD_BUS_PROPERTY("CanGraphical", "b", property_get_can_graphical, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
|
||||
SD_BUS_PROPERTY("Sessions", "a(so)", property_get_sessions, 0, 0),
|
||||
|
@ -104,11 +104,10 @@ int seat_save(Seat *s) {
|
||||
fprintf(f,
|
||||
"# This is private data. Do not parse.\n"
|
||||
"IS_SEAT0=%i\n"
|
||||
"CAN_MULTI_SESSION=%i\n"
|
||||
"CAN_MULTI_SESSION=1\n"
|
||||
"CAN_TTY=%i\n"
|
||||
"CAN_GRAPHICAL=%i\n",
|
||||
seat_is_seat0(s),
|
||||
seat_can_multi_session(s),
|
||||
seat_can_tty(s),
|
||||
seat_can_graphical(s));
|
||||
|
||||
@ -558,13 +557,6 @@ bool seat_is_seat0(Seat *s) {
|
||||
return s->manager->seat0 == s;
|
||||
}
|
||||
|
||||
bool seat_can_multi_session(Seat *s) {
|
||||
assert(s);
|
||||
|
||||
/* multiple sessions are supported on all seats now */
|
||||
return true;
|
||||
}
|
||||
|
||||
bool seat_can_tty(Seat *s) {
|
||||
assert(s);
|
||||
|
||||
|
@ -51,7 +51,6 @@ void seat_claim_position(Seat *s, Session *session, unsigned pos);
|
||||
|
||||
bool seat_has_vts(Seat *s);
|
||||
bool seat_is_seat0(Seat *s);
|
||||
bool seat_can_multi_session(Seat *s);
|
||||
bool seat_can_tty(Seat *s);
|
||||
bool seat_has_master_device(Seat *s);
|
||||
bool seat_can_graphical(Seat *s);
|
||||
|
@ -177,7 +177,7 @@ int sd_bus_get_sender(sd_bus *bus, const char **ret);
|
||||
|
||||
int sd_bus_start(sd_bus *bus);
|
||||
|
||||
int sd_bus_try_close(sd_bus *bus) _sd_deprecated_; /* deprecated */
|
||||
int sd_bus_try_close(sd_bus *bus) _sd_deprecated_;
|
||||
void sd_bus_close(sd_bus *bus);
|
||||
|
||||
sd_bus* sd_bus_ref(sd_bus *bus);
|
||||
@ -204,7 +204,7 @@ int sd_bus_get_fd(sd_bus *bus);
|
||||
int sd_bus_get_events(sd_bus *bus);
|
||||
int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec);
|
||||
int sd_bus_process(sd_bus *bus, sd_bus_message **r);
|
||||
int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r) _sd_deprecated_; /* deprecated */
|
||||
int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r) _sd_deprecated_;
|
||||
int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec);
|
||||
int sd_bus_flush(sd_bus *bus);
|
||||
int sd_bus_enqueue_for_read(sd_bus *bus, sd_bus_message *m);
|
||||
@ -272,7 +272,7 @@ int sd_bus_message_seal(sd_bus_message *m, uint64_t cookie, uint64_t timeout_use
|
||||
int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type);
|
||||
int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie);
|
||||
int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie);
|
||||
int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) _sd_deprecated_; /* deprecated */
|
||||
int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority) _sd_deprecated_;
|
||||
|
||||
int sd_bus_message_get_expect_reply(sd_bus_message *m);
|
||||
int sd_bus_message_get_auto_start(sd_bus_message *m);
|
||||
@ -306,7 +306,7 @@ int sd_bus_message_set_allow_interactive_authorization(sd_bus_message *m, int b)
|
||||
|
||||
int sd_bus_message_set_destination(sd_bus_message *m, const char *destination);
|
||||
int sd_bus_message_set_sender(sd_bus_message *m, const char *sender);
|
||||
int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) _sd_deprecated_; /* deprecated */
|
||||
int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority) _sd_deprecated_;
|
||||
|
||||
int sd_bus_message_append(sd_bus_message *m, const char *types, ...);
|
||||
int sd_bus_message_appendv(sd_bus_message *m, const char *types, va_list ap);
|
||||
|
@ -72,7 +72,7 @@ enum {
|
||||
SD_JOURNAL_ALL_NAMESPACES = 1 << 5, /* Show all namespaces, not just the default or specified one */
|
||||
SD_JOURNAL_INCLUDE_DEFAULT_NAMESPACE = 1 << 6, /* Show default namespace in addition to specified one */
|
||||
|
||||
SD_JOURNAL_SYSTEM_ONLY _sd_deprecated_ = SD_JOURNAL_SYSTEM /* deprecated name */
|
||||
SD_JOURNAL_SYSTEM_ONLY _sd_deprecated_ = SD_JOURNAL_SYSTEM /* old name */
|
||||
};
|
||||
|
||||
/* Wakeup event types */
|
||||
@ -88,7 +88,7 @@ int sd_journal_open_directory(sd_journal **ret, const char *path, int flags);
|
||||
int sd_journal_open_directory_fd(sd_journal **ret, int fd, int flags);
|
||||
int sd_journal_open_files(sd_journal **ret, const char **paths, int flags);
|
||||
int sd_journal_open_files_fd(sd_journal **ret, int fds[], unsigned n_fds, int flags);
|
||||
int sd_journal_open_container(sd_journal **ret, const char *machine, int flags) _sd_deprecated_; /* deprecated */
|
||||
int sd_journal_open_container(sd_journal **ret, const char *machine, int flags) _sd_deprecated_;
|
||||
void sd_journal_close(sd_journal *j);
|
||||
|
||||
int sd_journal_previous(sd_journal *j);
|
||||
|
@ -183,7 +183,7 @@ int sd_seat_get_active(const char *seat, char **session, uid_t *uid);
|
||||
int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **uid, unsigned *n_uids);
|
||||
|
||||
/* Return whether the seat is multi-session capable */
|
||||
int sd_seat_can_multi_session(const char *seat);
|
||||
int sd_seat_can_multi_session(const char *seat) _sd_deprecated_;
|
||||
|
||||
/* Return whether the seat is TTY capable, i.e. suitable for showing console UIs */
|
||||
int sd_seat_can_tty(const char *seat);
|
||||
|
@ -11,6 +11,7 @@ deprecated="
|
||||
-e sd_bus_process_priority
|
||||
-e sd_bus_message_get_priority
|
||||
-e sd_bus_message_set_priority
|
||||
-e sd_seat_can_multi_session
|
||||
"
|
||||
|
||||
for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv $deprecated | sort -u` ; do
|
||||
|
Loading…
x
Reference in New Issue
Block a user