patch-2.1.28 linux/net/core/sock.c

Next file: linux/net/ipv4/af_inet.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.27/linux/net/core/sock.c linux/net/core/sock.c
@@ -328,17 +328,14 @@
 		
 		case SO_LINGER:	
 		  {
-		        int err;
 			len=min(len,sizeof(ling));
 			if (put_user(len, optlen)) 
-			if (!err) {
-				ling.l_onoff=sk->linger;
-				ling.l_linger=sk->lingertime;
-				err = copy_to_user(optval,&ling,len);
-				if (err)
-				    err = -EFAULT;
-			}
-			return err;
+				return -EFAULT;
+			ling.l_onoff=sk->linger;
+			ling.l_linger=sk->lingertime;
+			if (copy_to_user(optval,&ling,len))
+				return -EFAULT;
+			return 0;
 		  }
 		
 		case SO_BSDCOMPAT:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov