[Pm-utils] [patch review 1/2] You know, the original reason pm_main was moved to functions is because it was shared between pm-suspend and pm-hibernate. Since all those scripts are not symlinks to pm-action, we do not need a pm_main in functions cluttering up the namespace.
Victor Lowther
victor.lowther at gmail.com
Wed Feb 6 21:16:42 PST 2008
This patch clones pm-main functionality in pm-action
---
src/pm-action.in | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/pm-action.in b/src/pm-action.in
index b9b32dd..b1a8bf6 100644
--- a/src/pm-action.in
+++ b/src/pm-action.in
@@ -121,6 +121,10 @@ esac
export PM_CMDLINE="$@"
-pm_main "$(echo $ACTION | tr - _)" "$REVERSE"
+take_suspend_lock || exit 1
+trap remove_suspend_lock 0
+init_logfile "${PM_LOGFILE}"
+rm -f "${INHIBIT}"
+run_hooks sleep "$(echo $ACTION | tr - _)" reverse "$REVERSE"
exit $?
--
1.5.3.8
More information about the Pm-utils
mailing list