]> err.no Git - yubikey-personalization/commitdiff
Exit with non-zero exit code on no yubikey present errors.
authorsimon75j <simon75j@b62f149e-849f-11dd-9899-c7ba65f7c4c7>
Tue, 8 Sep 2009 08:43:00 +0000 (08:43 +0000)
committersimon75j <simon75j@b62f149e-849f-11dd-9899-c7ba65f7c4c7>
Tue, 8 Sep 2009 08:43:00 +0000 (08:43 +0000)
Reported by Greg Woods.

git-svn-id: https://yubikey-personalization.googlecode.com/svn/trunk@181 b62f149e-849f-11dd-9899-c7ba65f7c4c7

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;
        }