aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/syscall.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/syscall.c')
-rw-r--r--arch/mips/kernel/syscall.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 9951240cc3fd..970e3e96b1d0 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -231,7 +231,7 @@ out:
231 */ 231 */
232asmlinkage int sys_uname(struct old_utsname __user * name) 232asmlinkage int sys_uname(struct old_utsname __user * name)
233{ 233{
234 if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) 234 if (name && !copy_to_user(name, utsname(), sizeof (*name)))
235 return 0; 235 return 0;
236 return -EFAULT; 236 return -EFAULT;
237} 237}
@@ -248,16 +248,21 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
248 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) 248 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
249 return -EFAULT; 249 return -EFAULT;
250 250
251 error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); 251 error = __copy_to_user(&name->sysname, &utsname()->sysname,
252 error -= __put_user(0,name->sysname+__OLD_UTS_LEN); 252 __OLD_UTS_LEN);
253 error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); 253 error -= __put_user(0, name->sysname + __OLD_UTS_LEN);
254 error -= __put_user(0,name->nodename+__OLD_UTS_LEN); 254 error -= __copy_to_user(&name->nodename, &utsname()->nodename,
255 error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); 255 __OLD_UTS_LEN);
256 error -= __put_user(0,name->release+__OLD_UTS_LEN); 256 error -= __put_user(0, name->nodename + __OLD_UTS_LEN);
257 error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); 257 error -= __copy_to_user(&name->release, &utsname()->release,
258 error -= __put_user(0,name->version+__OLD_UTS_LEN); 258 __OLD_UTS_LEN);
259 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 259 error -= __put_user(0, name->release + __OLD_UTS_LEN);
260 error = __put_user(0,name->machine+__OLD_UTS_LEN); 260 error -= __copy_to_user(&name->version, &utsname()->version,
261 __OLD_UTS_LEN);
262 error -= __put_user(0, name->version + __OLD_UTS_LEN);
263 error -= __copy_to_user(&name->machine, &utsname()->machine,
264 __OLD_UTS_LEN);
265 error = __put_user(0, name->machine + __OLD_UTS_LEN);
261 error = error ? -EFAULT : 0; 266 error = error ? -EFAULT : 0;
262 267
263 return error; 268 return error;