Bug 32210

Summary: Failed hooks do not inhibit pm-actions [PATCH]
Product: pm-utils Reporter: ariel cornejo <arielCo>
Component: GeneralAssignee: Richard Hughes <richard>
Status: RESOLVED DUPLICATE QA Contact:
Severity: major    
Priority: medium CC: arielCo, freedesktop-bugs
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: patch for pm-functions.in

Description ariel cornejo 2010-12-07 20:02:35 UTC
Created attachment 40891 [details] [review]
patch for pm-functions.in

Since 1.4.0, _run_hook calls a log() after running the hook, and thus loses the hook exit status:

199 	hook_ok "$1" && "$@"
200 	log ""
201 	log -n "$*: " 
202 	hook_exit_status $? && LAST_HOOK="${1##*/}" || inhibit 

I attached a simple patch that seems to fix it.

This is important because e.g. a script that unmounts SD/MMC cards before suspending cannot inhibit it if the card is busy (see https://help.ubuntu.com/community/AspireOne/Ubuntu9.10?action=recall&rev=69).

Regards,
  Ariel
Comment 1 ariel cornejo 2010-12-22 04:18:35 UTC
Umm, I hoped there would be some kind of reply by now. Should I learn git and try to submit the patch there?
Comment 2 /df 2016-08-17 18:07:59 UTC

*** This bug has been marked as a duplicate of bug 40286 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.