patch-2.1.117 linux/net/socket.c

Next file: linux/net/sunrpc/clnt.c
Previous file: linux/net/core/dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.116/linux/net/socket.c linux/net/socket.c
@@ -105,7 +105,7 @@
 			      struct poll_table_struct *wait);
 static int sock_ioctl(struct inode *inode, struct file *file,
 		      unsigned int cmd, unsigned long arg);
-static int sock_fasync(struct file *filp, int on);
+static int sock_fasync(int fd, struct file *filp, int on);
 
 
 /*
@@ -483,7 +483,7 @@
 		printk(KERN_DEBUG "sock_close: NULL inode\n");
 		return 0;
 	}
-	sock_fasync(filp, 0);
+	sock_fasync(-1, filp, 0);
 	sock_release(socki_lookup(inode));
 	return 0;
 }
@@ -492,7 +492,7 @@
  *	Update the socket async list
  */
 
-static int sock_fasync(struct file *filp, int on)
+static int sock_fasync(int fd, struct file *filp, int on)
 {
 	struct fasync_struct *fa, *fna=NULL, **prev;
 	struct socket *sock;
@@ -520,11 +520,13 @@
 	{
 		if(fa!=NULL)
 		{
+			fa->fa_fd=fd;
 			kfree_s(fna,sizeof(struct fasync_struct));
 			restore_flags(flags);
 			return 0;
 		}
 		fna->fa_file=filp;
+		fna->fa_fd=fd;
 		fna->magic=FASYNC_MAGIC;
 		fna->fa_next=sock->fasync_list;
 		sock->fasync_list=fna;

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