summaryrefslogtreecommitdiff
path: root/pinentry-dmenu.c
diff options
context:
space:
mode:
authorMoritz Luedecke <ritze@skweez.net>2018-01-24 18:13:57 +0100
committerMoritz Luedecke <ritze@skweez.net>2018-01-25 10:14:18 +0100
commite583cf17b10dcf20c83cfb89682b24bba0a1dbf9 (patch)
tree42f02a2eea8e1a425b75d19cd0b299671dc94d68 /pinentry-dmenu.c
parente782992eae8d256390d37a7b7605b9ba50bf4fe0 (diff)
Set pinentry->result
Diffstat (limited to 'pinentry-dmenu.c')
-rw-r--r--pinentry-dmenu.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/pinentry-dmenu.c b/pinentry-dmenu.c
index f17c13d..1e41f68 100644
--- a/pinentry-dmenu.c
+++ b/pinentry-dmenu.c
@@ -583,7 +583,7 @@ catchsig(int sig) {
}
}
-static int
+static void
password(void) {
winmode = WinPin;
@@ -600,27 +600,26 @@ password(void) {
return 0;
}
- pinentry->repeat_okay = 1;
+ if (pinentry->canceled) {
+ pinentry->result = -1;
+ return;
}
- return (pinentry->canceled) ? -1 : 1;
+ pinentry->result = strlen(pinentry->pin);
}
-static int
+static void
confirm(void) {
winmode = WinConfirm;
sel = Nothing;
-
run();
-
- return sel != No;
+ pinentry->result = sel != No;
}
static int
cmdhandler(pinentry_t received_pinentry) {
struct sigaction sa;
XWindowAttributes wa;
- int ret;
pinentry = received_pinentry;
@@ -655,14 +654,14 @@ cmdhandler(pinentry_t received_pinentry) {
setup();
if (pinentry->pin) {
- ret = password();
+ password();
} else {
- ret = confirm();
+ confirm();
}
cleanup();
- return ret;
+ return pinentry->result;
}
pinentry_cmd_handler_t pinentry_cmd_handler = cmdhandler;