Support calling device_drive_eject() and device_filesystem_unmount() from daemon
authorMartin Pitt <martin.pitt@ubuntu.com>
Sun, 3 Apr 2011 21:02:46 +0000 (23:02 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Sun, 3 Apr 2011 22:10:23 +0000 (00:10 +0200)
commit378a755bbe24e1118caa6a278bcbc585213e7a05
tree3350d0778cfa051ca494f8dbbf42df6168751a2e
parentaf80cd56e3b68cbc0de1fa1d03f9b2b2463aa514
Support calling device_drive_eject() and device_filesystem_unmount() from daemon

In device_drive_eject() and device_filesystem_unmount(), only specify a
PolicyKit action if we actually have a D-BUS invocation context. If not, the
method is called from within the daemon, so use a NULL PK action to avoid a
crash. This is similar to device_drive_ata_smart_refresh_data().

Use the throw_error() wrapper instead of direct dbus_g_method_return_error(),
to support NULL contexts.
src/device.c