From f1d3e2f2170c9bd7fbfe215e586ecd1fd580904a Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 4 May 2016 13:52:59 +0200 Subject: fix error condition for yk_init() --- udev/ykfde.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'udev') 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; } -- cgit v1.2.3-70-g09d2