patch-2.4.0-test8 linux/arch/sparc64/solaris/misc.c

Next file: linux/arch/sparc64/solaris/signal.c
Previous file: linux/arch/sparc64/solaris/fs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test7/linux/arch/sparc64/solaris/misc.c linux/arch/sparc64/solaris/misc.c
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.29 2000/08/14 23:50:31 anton Exp $
+/* $Id: misc.c,v 1.30 2000/08/29 07:01:54 davem Exp $
  * misc.c: Miscelaneous syscall emulation for Solaris
  *
  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -139,12 +139,14 @@
 	int i, len = (countfrom) ? 					\
 		((sizeof(to) > sizeof(from) ? 				\
 			sizeof(from) : sizeof(to))) : sizeof(to); 	\
-	copy_to_user_ret(to, from, len, -EFAULT); 			\
+	if (copy_to_user(to, from, len))				\
+		return -EFAULT;						\
 	if (dotchop) 							\
 		for (p=from,i=0; *p && *p != '.' && --len; p++,i++); 	\
 	else 								\
 		i = len - 1; 						\
-	__put_user_ret('\0', (char *)(to+i), -EFAULT); 			\
+	if (__put_user('\0', (char *)(to+i)))				\
+		return -EFAULT;						\
 }
 
 struct sol_uname {
@@ -297,10 +299,13 @@
 	}
 	len = strlen(r) + 1;
 	if (count < len) {
-		copy_to_user_ret((char *)A(buf), r, count - 1, -EFAULT);
-		__put_user_ret(0, (char *)A(buf) + count - 1, -EFAULT);
-	} else
-		copy_to_user_ret((char *)A(buf), r, len, -EFAULT);
+		if (copy_to_user((char *)A(buf), r, count - 1) ||
+		    __put_user(0, (char *)A(buf) + count - 1))
+			return -EFAULT;
+	} else {
+		if (copy_to_user((char *)A(buf), r, len))
+			return -EFAULT;
+	}
 	return len;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)