summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/ykfde.c5
-rw-r--r--udev/ykfde.c5
2 files changed, 6 insertions, 4 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;
}
diff --git a/udev/ykfde.c b/udev/ykfde.c
index 3d303e6..246425f 100644
--- a/udev/ykfde.c
+++ b/udev/ykfde.c
@@ -231,14 +231,15 @@ int main(int argc, char **argv) {
memset(challenge, 0, CHALLENGELEN + 1);
/* init and open first Yubikey */
- if ((rc = yk_init()) < 0) {
+ if (yk_init() == 0) {
perror("yk_init() failed");
+ rc = EXIT_FAILURE;
goto out10;
}
if ((yk = yk_open_first_key()) == NULL) {
- rc = EXIT_FAILURE;
perror("yk_open_first_key() failed");
+ rc = EXIT_FAILURE;
goto out20;
}