Skip to content

Commit

Permalink
[PA-RISC] Fix parisc_newuname()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Wilcox authored and Matthew Wilcox committed Oct 5, 2006
1 parent ccd6c35 commit f64ef29
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions arch/parisc/kernel/sys_parisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit f64ef29

Please sign in to comment.