diff options
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 398d57923f9..3a4776e8f16 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1655,7 +1655,7 @@ asmlinkage long sys_newuname(struct new_utsname __user * name) | |||
1655 | int errno = 0; | 1655 | int errno = 0; |
1656 | 1656 | ||
1657 | down_read(&uts_sem); | 1657 | down_read(&uts_sem); |
1658 | if (copy_to_user(name,&system_utsname,sizeof *name)) | 1658 | if (copy_to_user(name, utsname(), sizeof *name)) |
1659 | errno = -EFAULT; | 1659 | errno = -EFAULT; |
1660 | up_read(&uts_sem); | 1660 | up_read(&uts_sem); |
1661 | return errno; | 1661 | return errno; |
@@ -1673,8 +1673,8 @@ asmlinkage long sys_sethostname(char __user *name, int len) | |||
1673 | down_write(&uts_sem); | 1673 | down_write(&uts_sem); |
1674 | errno = -EFAULT; | 1674 | errno = -EFAULT; |
1675 | if (!copy_from_user(tmp, name, len)) { | 1675 | if (!copy_from_user(tmp, name, len)) { |
1676 | memcpy(system_utsname.nodename, tmp, len); | 1676 | memcpy(utsname()->nodename, tmp, len); |
1677 | system_utsname.nodename[len] = 0; | 1677 | utsname()->nodename[len] = 0; |
1678 | errno = 0; | 1678 | errno = 0; |
1679 | } | 1679 | } |
1680 | up_write(&uts_sem); | 1680 | up_write(&uts_sem); |
@@ -1690,11 +1690,11 @@ asmlinkage long sys_gethostname(char __user *name, int len) | |||
1690 | if (len < 0) | 1690 | if (len < 0) |
1691 | return -EINVAL; | 1691 | return -EINVAL; |
1692 | down_read(&uts_sem); | 1692 | down_read(&uts_sem); |
1693 | i = 1 + strlen(system_utsname.nodename); | 1693 | i = 1 + strlen(utsname()->nodename); |
1694 | if (i > len) | 1694 | if (i > len) |
1695 | i = len; | 1695 | i = len; |
1696 | errno = 0; | 1696 | errno = 0; |
1697 | if (copy_to_user(name, system_utsname.nodename, i)) | 1697 | if (copy_to_user(name, utsname()->nodename, i)) |
1698 | errno = -EFAULT; | 1698 | errno = -EFAULT; |
1699 | up_read(&uts_sem); | 1699 | up_read(&uts_sem); |
1700 | return errno; | 1700 | return errno; |
@@ -1719,8 +1719,8 @@ asmlinkage long sys_setdomainname(char __user *name, int len) | |||
1719 | down_write(&uts_sem); | 1719 | down_write(&uts_sem); |
1720 | errno = -EFAULT; | 1720 | errno = -EFAULT; |
1721 | if (!copy_from_user(tmp, name, len)) { | 1721 | if (!copy_from_user(tmp, name, len)) { |
1722 | memcpy(system_utsname.domainname, tmp, len); | 1722 | memcpy(utsname()->domainname, tmp, len); |
1723 | system_utsname.domainname[len] = 0; | 1723 | utsname()->domainname[len] = 0; |
1724 | errno = 0; | 1724 | errno = 0; |
1725 | } | 1725 | } |
1726 | up_write(&uts_sem); | 1726 | up_write(&uts_sem); |