patch-2.1.115 linux/arch/sparc/kernel/sys_sparc.c

Next file: linux/arch/sparc/kernel/sys_sunos.c
Previous file: linux/arch/sparc/kernel/sun4setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sys_sparc.c linux/arch/sparc/kernel/sys_sparc.c
@@ -1,4 +1,4 @@
-/* $Id: sys_sparc.c,v 1.40 1998/03/28 08:29:26 davem Exp $
+/* $Id: sys_sparc.c,v 1.46 1998/08/03 23:58:01 davem Exp $
  * linux/arch/sparc/kernel/sys_sparc.c
  *
  * This file contains various random system calls that
@@ -37,19 +37,11 @@
 
 asmlinkage unsigned long sparc_brk(unsigned long brk)
 {
-	unsigned long ret;
-
-	lock_kernel();
 	if(ARCH_SUN4C_SUN4) {
-		if(brk >= 0x20000000 && brk < 0xe0000000) {
-			ret = current->mm->brk;
-			goto out;
-		}
+		if(brk >= 0x20000000 && brk < 0xe0000000)
+			return current->mm->brk;
 	}
-	ret = sys_brk(brk);
-out:
-	unlock_kernel();
-	return ret;
+	return sys_brk(brk);
 }
 
 /*
@@ -181,8 +173,6 @@
 	return err;
 }
 
-extern unsigned long get_unmapped_area(unsigned long addr, unsigned long len);
-
 /* Linux version of mmap */
 asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
 	unsigned long prot, unsigned long flags, unsigned long fd,
@@ -334,22 +324,22 @@
 
 asmlinkage int sys_getdomainname(char *name, int len)
 {
-	int nlen;
-	int err = -EFAULT;
-	
-	down(&uts_sem);
-	
-	nlen = strlen(system_utsname.domainname);
+ 	int nlen;
+ 	int err = -EFAULT;
+ 	
+ 	down(&uts_sem);
+ 	
+	nlen = strlen(system_utsname.domainname) + 1;
 
 	if (nlen < len)
 		len = nlen;
 	if(len > __NEW_UTS_LEN)
-		goto done
+		goto done;
 	if(copy_to_user(name, system_utsname.domainname, len))
 		goto done;
-	err=0;
-done:	
-	up(&uts_sem);	
+	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