summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2006-10-04 13:33:53 -0600
committerMatthew Wilcox <willy@hera.kernel.org>2006-10-05 01:48:18 +0000
commitf64ef295032d07345ca26bf4876a1577c4dccb37 (patch)
tree483805b05c4d0cc7e3e7072445479564e25800a2
parentccd6c355e89a21d9047ae19471629758d3a01959 (diff)
[PA-RISC] Fix parisc_newuname()
The utsname virtualisation broke parisc_newuname compilation. Rewrite the implementation to call sys_newuname() like sparc64 does. Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
-rw-r--r--arch/parisc/kernel/sys_parisc.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 1db5588ceacf..512642d8f707 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality)
return err;
}
-static inline int override_machine(char __user *mach) {
-#ifdef CONFIG_COMPAT
- if (personality(current->personality) == PER_LINUX32) {
- if (__put_user(0, mach + 6) ||
- __put_user(0, mach + 7))
- return -EFAULT;
- }
-
- return 0;
-#else /*!CONFIG_COMPAT*/
- return 0;
-#endif /*CONFIG_COMPAT*/
-}
-
-long parisc_newuname(struct new_utsname __user *utsname)
+long parisc_newuname(struct new_utsname __user *name)
{
- int err = 0;
+ int err = sys_newuname(name);
- down_read(&uts_sem);
- if (copy_to_user(utsname, &system_utsname, sizeof(*utsname)))
- err = -EFAULT;
- up_read(&uts_sem);
-
- err = override_machine(utsname->machine);
+#ifdef CONFIG_COMPAT
+ if (!err && personality(current->personality) == PER_LINUX32) {
+ if (__put_user(0, name->machine + 6) ||
+ __put_user(0, name->machine + 7))
+ err = -EFAULT;
+ }
+#endif
- return (long)err;
+ return err;
}