scd: More fix of error return path.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 May 2016 06:56:02 +0000 (15:56 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 May 2016 06:59:22 +0000 (15:59 +0900)
* scd/command.c (open_card): Return GPG_ERR_ENODEV on the failure of
apdu_connect.

--

GnuPG-bug-id: 2306
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/command.c

index 4e80d76..72ff132 100644 (file)
@@ -469,8 +469,8 @@ open_card (ctrl_t ctrl, const char *apptype)
           else if (sw == SW_HOST_CARD_INACTIVE)
             err = gpg_error (GPG_ERR_CARD_RESET);
           else
-            err = gpg_error (GPG_ERR_CARD);
-       }
+            err = gpg_error (GPG_ERR_ENODEV);
+        }
       else
         err = select_application (ctrl, slot, apptype, &ctrl->app_ctx);
     }