/[pkgs]/devel/DeviceKit-disks/0001-Actually-inhibit-the-daemon-when-Inhibit-is-called.patch
ViewVC logotype

Contents of /devel/DeviceKit-disks/0001-Actually-inhibit-the-daemon-when-Inhibit-is-called.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Mon Oct 5 18:42:18 2009 UTC (7 weeks ago) by davidz
Branch: MAIN
CVS Tags: DeviceKit-disks-007-2_fc12, HEAD
File MIME type: text/x-patch
* Mon Oct 05 2009 David Zeuthen <davidz@redhat.com> - 007-2%{?dist}
- Actually inhibit the daemon (#527091)
1 From e672ccb6917772f2e7f0f4294eb2828193eaa89f Mon Sep 17 00:00:00 2001
2 From: David Zeuthen <davidz@redhat.com>
3 Date: Mon, 5 Oct 2009 14:31:22 -0400
4 Subject: [PATCH] Actually inhibit the daemon when Inhibit() is called
5
6 Guess this was forgotten with the polkit-1 porting effort.
7 ---
8 src/devkit-disks-daemon.c | 10 ++++++++--
9 src/devkit-disks-daemon.h | 2 +-
10 2 files changed, 9 insertions(+), 3 deletions(-)
11
12 diff --git a/src/devkit-disks-daemon.c b/src/devkit-disks-daemon.c
13 index b8c933b..e3f5bc6 100644
14 --- a/src/devkit-disks-daemon.c
15 +++ b/src/devkit-disks-daemon.c
16 @@ -1288,7 +1288,13 @@ devkit_disks_daemon_local_check_auth (DevkitDisksDaemon *daemon,
17 }
18 va_end (va_args);
19
20 - if (action_id != NULL) {
21 + if (devkit_disks_daemon_local_is_inhibited (daemon)) {
22 + throw_error (data->context,
23 + DEVKIT_DISKS_ERROR_INHIBITED,
24 + "Daemon is inhibited");
25 + check_auth_data_free (data);
26 +
27 + } else if (action_id != NULL) {
28 PolkitSubject *subject;
29 PolkitDetails *details;
30 PolkitCheckAuthorizationFlags flags;
31 @@ -1783,7 +1789,7 @@ daemon_inhibitor_disconnected_cb (DevkitDisksInhibitor *inhibitor,
32 }
33
34 gboolean
35 -devkit_disks_daemon_local_has_inhibitors (DevkitDisksDaemon *daemon)
36 +devkit_disks_daemon_local_is_inhibited (DevkitDisksDaemon *daemon)
37 {
38 return daemon->priv->inhibitors != NULL;
39 }
40 diff --git a/src/devkit-disks-daemon.h b/src/devkit-disks-daemon.h
41 index dd0a4f0..3164734 100644
42 --- a/src/devkit-disks-daemon.h
43 +++ b/src/devkit-disks-daemon.h
44 @@ -123,7 +123,7 @@ void devkit_disks_daemon_local_update_spindown (DevkitDisksDae
45
46 gboolean devkit_disks_daemon_local_has_polling_inhibitors (DevkitDisksDaemon *daemon);
47
48 -gboolean devkit_disks_daemon_local_has_inhibitors (DevkitDisksDaemon *daemon);
49 +gboolean devkit_disks_daemon_local_is_inhibited (DevkitDisksDaemon *daemon);
50
51 DevkitDisksMountMonitor *devkit_disks_daemon_local_get_mount_monitor (DevkitDisksDaemon *daemon);
52
53 --
54 1.6.5.rc2
55

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2