aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sbus')
-rw-r--r--drivers/sbus/char/bbc_envctrl.c5
-rw-r--r--drivers/sbus/char/envctrl.c7
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c
index 1cc706e11119..d27e4f6d7045 100644
--- a/drivers/sbus/char/bbc_envctrl.c
+++ b/drivers/sbus/char/bbc_envctrl.c
@@ -4,9 +4,6 @@
4 * Copyright (C) 2001 David S. Miller (davem@redhat.com) 4 * Copyright (C) 2001 David S. Miller (davem@redhat.com)
5 */ 5 */
6 6
7#define __KERNEL_SYSCALLS__
8static int errno;
9
10#include <linux/kernel.h> 7#include <linux/kernel.h>
11#include <linux/kthread.h> 8#include <linux/kthread.h>
12#include <linux/sched.h> 9#include <linux/sched.h>
@@ -200,7 +197,7 @@ static void do_envctrl_shutdown(struct bbc_cpu_temperature *tp)
200 printk(KERN_CRIT "kenvctrld: Shutting down the system now.\n"); 197 printk(KERN_CRIT "kenvctrld: Shutting down the system now.\n");
201 198
202 shutting_down = 1; 199 shutting_down = 1;
203 if (execve("/sbin/shutdown", argv, envp) < 0) 200 if (kernel_execve("/sbin/shutdown", argv, envp) < 0)
204 printk(KERN_CRIT "envctrl: shutdown execution failed\n"); 201 printk(KERN_CRIT "envctrl: shutdown execution failed\n");
205} 202}
206 203
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 }