]> git.neil.brown.name Git - susman.git/commit
request_suspend: change check for suspend-is-disabled.
authorNeilBrown <neilb@suse.de>
Thu, 15 Mar 2012 20:40:00 +0000 (07:40 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 15 Mar 2012 20:40:00 +0000 (07:40 +1100)
commitee489200b95099ed29a78cc8e16cd266939946d8
tree4b330d7436d570a5b88b2ffceae9624a1a3d073f
parent1b1e355046866ab4d19dac603967e422907169b0
request_suspend: change check for suspend-is-disabled.

Both request_suspend and lsusd try to abort the request if suspend is
disabled.  However as they use the same mechanism they can trip over
each other and produce the wrong result.

So leave the primary checking to lsusd.  It will remove  the 'request'
file if needed, so request_suspend will notice.  It can then check
if a suspend actually happened by examining the 'watching' file.

Also: change request_suspend to exit(2) on strange error, and exit(1)
only if suspend was blocked.

Signed-off-by: NeilBrown <neilb@suse.de>
request_suspend.c