]> err.no Git - yubikey-personalization/commitdiff
Exit with non-zero exit code on no yubikey present errors.
authorSimon Josefsson <simon@josefsson.org>
Tue, 8 Sep 2009 08:43:00 +0000 (08:43 +0000)
committerSimon Josefsson <simon@josefsson.org>
Tue, 8 Sep 2009 08:43:00 +0000 (08:43 +0000)
Reported by Greg Woods.

ykpersonalize.c

index 2576361a36d1c8b25c2a58ef2a05d2ac6b457d53..e90075e93914a0aeded0216ccf3bdb26332155a9 100644 (file)
@@ -181,13 +181,18 @@ main(int argc, char **argv)
        /* Assume the worst */
        error = true;
 
-       if (!yk_init())
+       if (!yk_init()) {
+               exit_code = 1;
                goto err;
+       }
 
-       if (!(yk = yk_open_first_key()))
+       if (!(yk = yk_open_first_key())) {
+               exit_code = 1;
                goto err;
+       }
 
        if (!yk_get_status(yk, st)) {
+               exit_code = 1;
                goto err;
        }