[gnome-settings-daemon/wip/smartcard-fixes: 2/2] sdfasdf asdf# plugins/cursor/fix-cursor.patch
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/smartcard-fixes: 2/2] sdfasdf asdf# plugins/cursor/fix-cursor.patch
- Date: Mon, 10 Feb 2014 22:59:15 +0000 (UTC)
commit 35c43517aba0d53f25301ecb3d58c6f1e808a6cf
Author: Ray Strode <rstrode redhat com>
Date: Mon Feb 10 17:58:49 2014 -0500
sdfasdf
asdf# plugins/cursor/fix-cursor.patch
plugins/smartcard/gsd-smartcard-manager.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/plugins/smartcard/gsd-smartcard-manager.c b/plugins/smartcard/gsd-smartcard-manager.c
index 5601d84..1d531c2 100644
--- a/plugins/smartcard/gsd-smartcard-manager.c
+++ b/plugins/smartcard/gsd-smartcard-manager.c
@@ -151,6 +151,7 @@ typedef struct
{
SECMODModule *driver;
GHashTable *smartcards;
+ int number_of_consecutive_errors;
} WatchSmartcardsOperation;
static void
@@ -191,16 +192,25 @@ watch_one_event_from_driver (GsdSmartcardManager *self,
error_code = PORT_GetError ();
- g_warning ("smartcard event function failed.");
+ operation->number_of_consecutive_errors++;
+ if (operation->number_of_consecutive_errors > 10) {
+ g_warning ("Got %d consecutive smartcard errors, so giving up.");
+
+ g_set_error (error,
+ GSD_SMARTCARD_MANAGER_ERROR,
+ GSD_SMARTCARD_MANAGER_ERROR_WITH_NSS,
+ "encountered unexpected error while "
+ "waiting for smartcard events (error %x)",
+ error_code);
+ return FALSE;
+ }
- g_set_error (error,
- GSD_SMARTCARD_MANAGER_ERROR,
- GSD_SMARTCARD_MANAGER_ERROR_WITH_NSS,
- "encountered unexpected error while "
- "waiting for smartcard events (error %d)",
- error_code);
- return FALSE;
+ g_warning ("Got potentially spurious smartcard event error: %x.", error_code);
+
+ sleep (1);
+ return TRUE;
}
+ operation->number_of_consecutive_errors = 0;
slot_id = PK11_GetSlotID (card);
slot_series = PK11_GetSlotSeries (card);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]