From ebcfb9551977066de4f79c267ac0d11aabd7ac16 Mon Sep 17 00:00:00 2001
From: Vlad Glagolev <stealth@sourcemage.org>
Date: Wed, 25 Jun 2014 15:35:46 +0400
Subject: [PATCH 08/23] shutdown: Fix critical segfault on invoking from Xen
 guest HVM DomU

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 login-utils/shutdown.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/login-utils/shutdown.c b/login-utils/shutdown.c
index 5f009129e508..38a9a084f529 100644
--- a/login-utils/shutdown.c
+++ b/login-utils/shutdown.c
@@ -210,10 +210,10 @@ main(int argc, char *argv[])
 	prog = argv[0];
 	if((ptr = strrchr(argv[0], '/'))) prog = ++ptr;
 
-	/* All names (halt, reboot, fasthalt, fastboot, shutdown)
+	/* All names (halt, poweroff, reboot, fasthalt, fastboot, shutdown)
 	   refer to the same program with the same options,
 	   only the defaults differ. */
-	if(!strcmp("halt", prog)) {
+	if(!strcmp("halt", prog) || !strcmp("poweroff", prog)) {
 		opt_reboot = 0;
 		opt_quiet = 1;
 		opt_fast = 0;
-- 
2.44.0

