summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2014-02-10 12:33:21 -0500
committerRay Strode <rstrode@redhat.com>2014-02-10 12:39:36 -0500
commit1a42dde560025b056d35ebf7ffd4175e3268ea04 (patch)
tree3dbcbc2c15a2117533eee6efe71d3fff5d020079
parent52c1ad8254035f282c854912d14263dc71e5d46c (diff)
downloadgnome-settings-daemon-1a42dde560025b056d35ebf7ffd4175e3268ea04.tar.gz
smartcard: detect explicit cancelation explicitly
If the the smartcard function has been cancelled (because, say, g-s-d is shutting down), handle that case explicitly, so the right error message is propagated.
-rw-r--r--plugins/smartcard/gsd-smartcard-manager.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/smartcard/gsd-smartcard-manager.c b/plugins/smartcard/gsd-smartcard-manager.c
index a4167701..5601d849 100644
--- a/plugins/smartcard/gsd-smartcard-manager.c
+++ b/plugins/smartcard/gsd-smartcard-manager.c
@@ -181,6 +181,11 @@ watch_one_event_from_driver (GsdSmartcardManager *self,
g_cancellable_disconnect (cancellable, handler_id);
+ if (g_cancellable_is_cancelled (cancellable)) {
+ g_warning ("smartcard event function cancelled");
+ return FALSE;
+ }
+
if (card == NULL) {
int error_code;
@@ -264,6 +269,10 @@ watch_smartcards_from_driver (GTask *task,
watch_succeeded = watch_one_event_from_driver (self, operation, cancellable, &error);
+ if (g_task_return_error_if_cancelled (task)) {
+ break;
+ }
+
if (!watch_succeeded) {
g_task_return_error (task, error);
break;