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

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