summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2016-05-04 13:52:59 +0200
committerGravatar Christian Hesse <mail@eworm.de>2016-05-04 13:52:59 +0200
commitf1d3e2f2170c9bd7fbfe215e586ecd1fd580904a (patch)
tree92eff8c8a55210934c015f6eb6dc6e8ba4312c5d /bin
parent2078941b3737d7a1d8b2d84a9771c18d33aa2925 (diff)
downloadmkinitcpio-ykfde-f1d3e2f2170c9bd7fbfe215e586ecd1fd580904a.tar.gz
mkinitcpio-ykfde-f1d3e2f2170c9bd7fbfe215e586ecd1fd580904a.tar.zst
fix error condition for yk_init()
Diffstat (limited to 'bin')
-rw-r--r--bin/ykfde.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/ykfde.c b/bin/ykfde.c
index bfdfa6b..c0bcd25 100644
--- a/bin/ykfde.c
+++ b/bin/ykfde.c
@@ -146,14 +146,15 @@ int main(int argc, char **argv) {
}
/* init and open first Yubikey */
- if ((rc = yk_init()) < 0) {
+ if (yk_init() == 0) {
perror("yk_init() failed");
+ rc = EXIT_FAILURE;
goto out20;
}
if ((yk = yk_open_first_key()) == NULL) {
- rc = EXIT_FAILURE;
fprintf(stderr, "No Yubikey available.\n");
+ rc = EXIT_FAILURE;
goto out30;
}