aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/sys_parisc.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2006-10-04 15:33:53 -0400
committerMatthew Wilcox <willy@hera.kernel.org>2006-10-04 21:48:18 -0400
commitf64ef295032d07345ca26bf4876a1577c4dccb37 (patch)
tree483805b05c4d0cc7e3e7072445479564e25800a2 /arch/parisc/kernel/sys_parisc.c
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>
Diffstat (limited to 'arch/parisc/kernel/sys_parisc.c')
-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)
266 return err; 266 return err;
267} 267}
268 268
269static inline int override_machine(char __user *mach) { 269long parisc_newuname(struct new_utsname __user *name)
270#ifdef CONFIG_COMPAT
271 if (personality(current->personality) == PER_LINUX32) {
272 if (__put_user(0, mach + 6) ||
273 __put_user(0, mach + 7))
274 return -EFAULT;
275 }
276
277 return 0;
278#else /*!CONFIG_COMPAT*/
279 return 0;
280#endif /*CONFIG_COMPAT*/
281}
282
283long parisc_newuname(struct new_utsname __user *utsname)
284{ 270{
285 int err = 0; 271 int err = sys_newuname(name);
286 272
287 down_read(&uts_sem); 273#ifdef CONFIG_COMPAT
288 if (copy_to_user(utsname, &system_utsname, sizeof(*utsname))) 274 if (!err && personality(current->personality) == PER_LINUX32) {
289 err = -EFAULT; 275 if (__put_user(0, name->machine + 6) ||
290 up_read(&uts_sem); 276 __put_user(0, name->machine + 7))
291 277 err = -EFAULT;
292 err = override_machine(utsname->machine); 278 }
279#endif
293 280
294 return (long)err; 281 return err;
295} 282}