summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-02-06 22:58:57 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-02-06 22:58:57 -0600
commita9169f14d8000709d23e70ebed783070000d9374 (patch)
tree4d5d06b33bd615b96a40a7cc58667e747cf39425
parent7b36dd7d2a95170f1bb676b2faf39159112accb3 (diff)
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. This patch clones pm-main functionality in pm-action
-rw-r--r--src/pm-action.in6
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 $?