mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
client: Consolidate cancelation replies
This commit is contained in:
parent
d164923e7c
commit
ceeab83fa8
@ -50,6 +50,15 @@ static struct pending_op {
|
|||||||
struct l_queue *saved_input;
|
struct l_queue *saved_input;
|
||||||
} pending_op;
|
} pending_op;
|
||||||
|
|
||||||
|
static struct l_dbus_message *agent_reply_canceled(
|
||||||
|
struct l_dbus_message *message,
|
||||||
|
const char *text)
|
||||||
|
{
|
||||||
|
return l_dbus_message_new_error(message,
|
||||||
|
IWD_AGENT_INTERFACE ".Error.Canceled",
|
||||||
|
"Error: %s", text);
|
||||||
|
}
|
||||||
|
|
||||||
static struct l_dbus_message *agent_error(const char *text)
|
static struct l_dbus_message *agent_error(const char *text)
|
||||||
{
|
{
|
||||||
display_error(text);
|
display_error(text);
|
||||||
@ -342,9 +351,8 @@ static void process_input_username_password(const char *prompt)
|
|||||||
if (l_queue_isempty(pending_op.saved_input)) {
|
if (l_queue_isempty(pending_op.saved_input)) {
|
||||||
/* received username */
|
/* received username */
|
||||||
if (!strlen(prompt)) {
|
if (!strlen(prompt)) {
|
||||||
reply = l_dbus_message_new_error(pending_message,
|
reply = agent_reply_canceled(pending_message,
|
||||||
IWD_AGENT_INTERFACE ".Error.Canceled",
|
"Canceled by user");
|
||||||
"Canceled by user");
|
|
||||||
goto send_reply;
|
goto send_reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -372,9 +380,8 @@ static void process_input_passphrase(const char *prompt)
|
|||||||
struct l_dbus_message *reply;
|
struct l_dbus_message *reply;
|
||||||
|
|
||||||
if (!strlen(prompt)) {
|
if (!strlen(prompt)) {
|
||||||
reply = l_dbus_message_new_error(pending_message,
|
reply = agent_reply_canceled(pending_message,
|
||||||
IWD_AGENT_INTERFACE ".Error.Canceled",
|
"Canceled by user");
|
||||||
"Canceled by user");
|
|
||||||
goto send_reply;
|
goto send_reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user