patch-2.1.106 linux/arch/sparc/kernel/sys_sparc.c
Next file: linux/drivers/block/amiflop.c
Previous file: linux/arch/m68k/mvme16x/rtc.c
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
Sat Jun 13 11:36:52 1998
- Orig file:
v2.1.105/linux/arch/sparc/kernel/sys_sparc.c
- Orig date:
Thu Apr 23 20:21:30 1998
diff -u --recursive --new-file v2.1.105/linux/arch/sparc/kernel/sys_sparc.c linux/arch/sparc/kernel/sys_sparc.c
@@ -334,15 +334,23 @@
asmlinkage int sys_getdomainname(char *name, int len)
{
- int nlen = strlen(system_utsname.domainname);
+ int nlen;
+ int err = -EFAULT;
+
+ down(&uts_sem);
+
+ nlen = strlen(system_utsname.domainname);
if (nlen < len)
len = nlen;
if(len > __NEW_UTS_LEN)
- return -EFAULT;
+ goto done
if(copy_to_user(name, system_utsname.domainname, len))
- return -EFAULT;
- return 0;
+ goto done;
+ err=0;
+done:
+ up(&uts_sem);
+ return err;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov