aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char/envctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sbus/char/envctrl.c')
-rw-r--r--drivers/sbus/char/envctrl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index 063e676a3ac0..728a133d0fc5 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -19,9 +19,6 @@
19 * Daniele Bellucci <bellucda@tiscali.it> 19 * Daniele Bellucci <bellucda@tiscali.it>
20 */ 20 */
21 21
22#define __KERNEL_SYSCALLS__
23static int errno;
24
25#include <linux/module.h> 22#include <linux/module.h>
26#include <linux/sched.h> 23#include <linux/sched.h>
27#include <linux/kthread.h> 24#include <linux/kthread.h>
@@ -976,13 +973,15 @@ static void envctrl_do_shutdown(void)
976 "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; 973 "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
977 char *argv[] = { 974 char *argv[] = {
978 "/sbin/shutdown", "-h", "now", NULL }; 975 "/sbin/shutdown", "-h", "now", NULL };
976 int ret;
979 977
980 if (inprog != 0) 978 if (inprog != 0)
981 return; 979 return;
982 980
983 inprog = 1; 981 inprog = 1;
984 printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n"); 982 printk(KERN_CRIT "kenvctrld: WARNING: Shutting down the system now.\n");
985 if (0 > execve("/sbin/shutdown", argv, envp)) { 983 ret = kernel_execve("/sbin/shutdown", argv, envp);
984 if (ret < 0) {
986 printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n"); 985 printk(KERN_CRIT "kenvctrld: WARNING: system shutdown failed!\n");
987 inprog = 0; /* unlikely to succeed, but we could try again */ 986 inprog = 0; /* unlikely to succeed, but we could try again */
988 } 987 }