summaryrefslogtreecommitdiff
path: root/src/ck-inhibit.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-21Add new DBUS method: ListInhibitorsEric Koegel1-5/+118
Returns the current list of inhibitors, an array of strings representing the what, who, why, mode, and two unsigned int32 representing the user ID and process ID. This is the same method that logind uses. Needed to have inhibit track the uid/pid of the caller to mirror what logind returns.
2015-06-07Add "mode" to the inhibit callEric Koegel1-17/+121
Now we support the mode string of the inhibit dbus call. It can either be a "block" or "delay". If no delay lock is done, a system call action will delay 2 seconds to give applications time to save state. Holding a delay lock will increase the timeout to a max of 8 seconds.
2015-04-13Add a test-manager programEric Koegel1-1/+1
Fix make distcheck, bump minimum glib to 2.40 since we're using that with this port to GDBus. Properly return the error messages when calling Inhbit and it fails and fix some other GDBus return values.
2014-12-08Add --with-rundir configure flagRobby Workman1-6/+6
This allows use of /run on tmpfs instead of /var/run without downstream symlink magic or patches.
2014-11-02Don't tie the inhibit locks to the who stringEric Koegel1-17/+34
This allows for multiple instances of the same app to hold a lock should they need to.
2014-10-21Escape the who string before using itEric Koegel1-1/+24
When creating the inhibit named pipe we need to ensure we escape the special characters out so that it's safe for use. This also sets up the test-inhibit program to try one such input.
2014-10-19g_return_val_if_fail can't be used in void functionEric Koegel1-1/+1
2014-10-19Make the inhibit locks inhibit the actionsEric Koegel1-1/+1
Also refactors some of the logging code to remove duplications. Not sure if the can or auth checks should return FALSE if there's an inhibit lock on the action... but that can be easily added in the future.
2014-10-19Inhibit Manager now emits event changed signalsEric Koegel1-2/+9
When the inhibit lock increments to 1 it will be TRUE and when it reaches 0 it will be FALSE. Additional locks above 1 will not emit a signal but the manager will keep track.
2014-10-18Fill in the inhibit manager someEric Koegel1-19/+45
And add additional tests for it as we go
2014-10-17Emit signals on inhibit changesEric Koegel1-2/+116
Also start working on the inhibit manager.
2014-10-15Use g_io_add_watch for the named pipeEric Koegel1-5/+7
2014-10-14Parse the what portion for inhibitEric Koegel1-9/+162
2014-10-14Add some tests for inhibit locksEric Koegel1-6/+91
2014-10-14More inhibit workEric Koegel1-24/+94
2014-10-13Start working on the inhibit filesEric Koegel1-0/+169
Might need an inhibit manager at some point in the future to track all these locks and prevent duplicates. We'll see how complex it needs to be.