/* wake up any blocked reads and perform async signalling */
wake_up_interruptible (&n_hdlc->read_wait);
- if (n_hdlc->tty->fasync != NULL)
-#if LINUX_VERSION_CODE < VERSION(2,3,0)
- kill_fasync (n_hdlc->tty->fasync, SIGIO);
-#else
- kill_fasync (n_hdlc->tty->fasync, SIGIO, POLL_IN);
-#endif
+ tty_send_fasync(&n_hdlc->tty->fasync);
} /* end of n_hdlc_tty_receive() */
/* n_hdlc_tty_read()
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/char/n_tty.c linux-2.3.99pre8+lock/drivers/char/n_tty.c
--- linux-2.3.99pre8-linus/drivers/char/n_tty.c Mon May 15 07:58:34 2000
+++ linux-2.3.99pre8+lock/drivers/char/n_tty.c Sat May 20 03:31:32 2000
@@ -630,8 +630,7 @@
put_tty_queue(c, tty);
tty->canon_head = tty->read_head;
tty->canon_data++;
- if (tty->fasync)
- kill_fasync(tty->fasync, SIGIO, POLL_IN);
+ tty_send_fasync(&tty->fasync);
if (waitqueue_active(&tty->read_wait))
wake_up_interruptible(&tty->read_wait);
return;
@@ -735,8 +734,7 @@
}
if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) {
- if (tty->fasync)
- kill_fasync(tty->fasync, SIGIO, POLL_IN);
+ tty_send_fasync(&tty->fasync);
if (waitqueue_active(&tty->read_wait))
wake_up_interruptible(&tty->read_wait);
}
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/char/pc110pad.c linux-2.3.99pre8+lock/drivers/char/pc110pad.c
--- linux-2.3.99pre8-linus/drivers/char/pc110pad.c Mon May 15 07:59:12 2000
+++ linux-2.3.99pre8+lock/drivers/char/pc110pad.c Sat May 20 03:32:54 2000
@@ -83,8 +83,7 @@
static void wake_readers(void)
{
wake_up_interruptible(&queue);
- if(asyncptr)
- kill_fasync(asyncptr, SIGIO, POLL_IN);
+ tty_send_fasync(&asyncptr);
}
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/char/pc_keyb.c linux-2.3.99pre8+lock/drivers/char/pc_keyb.c
--- linux-2.3.99pre8-linus/drivers/char/pc_keyb.c Mon May 15 07:58:34 2000
+++ linux-2.3.99pre8+lock/drivers/char/pc_keyb.c Sat May 20 03:32:31 2000
@@ -415,9 +415,8 @@
head = (head + 1) & (AUX_BUF_SIZE-1);
if (head != queue->tail) {
queue->head = head;
- if (queue->fasync)
- kill_fasync(queue->fasync, SIGIO, POLL_IN);
wake_up_interruptible(&queue->proc_list);
+ tty_send_fasync(&queue->fasync);
}
}
#endif
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/char/qpmouse.c linux-2.3.99pre8+lock/drivers/char/qpmouse.c
--- linux-2.3.99pre8-linus/drivers/char/qpmouse.c Sun Feb 20 18:36:53 2000
+++ linux-2.3.99pre8+lock/drivers/char/qpmouse.c Sat May 20 03:32:41 2000
@@ -133,8 +133,7 @@
head &= QP_BUF_SIZE-1;
}
queue->head = head;
- if (queue->fasync)
- kill_fasync(queue->fasync, SIGIO, POLL_IN);
+ tty_send_fasync(&queue->fasync);
wake_up_interruptible(&queue->proc_list);
}
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/char/rtc.c linux-2.3.99pre8+lock/drivers/char/rtc.c
--- linux-2.3.99pre8-linus/drivers/char/rtc.c Mon May 15 07:59:13 2000
+++ linux-2.3.99pre8+lock/drivers/char/rtc.c Sat May 20 03:32:17 2000
@@ -178,9 +178,7 @@
/* Now do the rest of the actions */
wake_up_interruptible(&rtc_wait);
-
- if (rtc_async_queue)
- kill_fasync (rtc_async_queue, SIGIO, POLL_IN);
+ tty_send_fasync(&rtc_async_queue);
}
#endif
@@ -775,9 +773,7 @@
/* Now we have new data */
wake_up_interruptible(&rtc_wait);
-
- if (rtc_async_queue)
- kill_fasync (rtc_async_queue, SIGIO, POLL_IN);
+ tty_send_fasync(&rtc_async_queue);
}
#endif
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/char/tty_io.c linux-2.3.99pre8+lock/drivers/char/tty_io.c
--- linux-2.3.99pre8-linus/drivers/char/tty_io.c Mon May 15 07:59:13 2000
+++ linux-2.3.99pre8+lock/drivers/char/tty_io.c Sat May 20 02:27:42 2000
@@ -1427,49 +1427,6 @@
return 0;
}
-/*
- * fasync_helper() is used by some character device drivers (mainly mice)
- * to set up the fasync queue. It returns negative on error, 0 if it did
- * no changes and positive if it added/deleted the entry.
- */
-int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp)
-{
- struct fasync_struct *fa, **fp;
- unsigned long flags;
-
- for (fp = fapp; (fa = *fp) != NULL; fp = &fa->fa_next) {
- if (fa->fa_file == filp)
- break;
- }
-
- if (on) {
- if (fa) {
- fa->fa_fd = fd;
- return 0;
- }
- fa = (struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
- if (!fa)
- return -ENOMEM;
- fa->magic = FASYNC_MAGIC;
- fa->fa_file = filp;
- fa->fa_fd = fd;
- save_flags(flags);
- cli();
- fa->fa_next = *fapp;
- *fapp = fa;
- restore_flags(flags);
- return 1;
- }
- if (!fa)
- return 0;
- save_flags(flags);
- cli();
- *fp = fa->fa_next;
- restore_flags(flags);
- kfree(fa);
- return 1;
-}
-
static int tty_fasync(int fd, struct file * filp, int on)
{
struct tty_struct * tty;
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/i2o/i2o_config.c linux-2.3.99pre8+lock/drivers/i2o/i2o_config.c
--- linux-2.3.99pre8-linus/drivers/i2o/i2o_config.c Mon May 15 07:59:13 2000
+++ linux-2.3.99pre8+lock/drivers/i2o/i2o_config.c Sat May 20 03:18:38 2000
@@ -161,8 +161,7 @@
// printk(KERN_INFO "File %p w/id %d has %d events\n",
// inf->fp, inf->q_id, inf->q_len);
@@ -382,8 +381,7 @@
/* We just completed a transaction, wake up whoever is awaiting
* this event.
*/
- if (sunmouse.fasync)
- kill_fasync (sunmouse.fasync, SIGIO, POLL_IN);
+ tty_send_fasync(&sunmouse.fasync);
wake_up_interruptible(&sunmouse.proc_list);
}
return;
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/scsi/sg.c linux-2.3.99pre8+lock/drivers/scsi/sg.c
--- linux-2.3.99pre8-linus/drivers/scsi/sg.c Tue Apr 25 02:13:23 2000
+++ linux-2.3.99pre8+lock/drivers/scsi/sg.c Sat May 20 03:07:40 2000
@@ -1052,8 +1052,7 @@
if (sfp && srp) {
/* Now wake up any sg_read() that is waiting for this packet. */
wake_up_interruptible(&sfp->read_wait);
- if (sfp->async_qp)
- kill_fasync(sfp->async_qp, SIGPOLL, POLL_IN);
+ kill_fasync(&sfp->async_qp, SIGPOLL, POLL_IN);
}
}
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/sgi/char/shmiq.c linux-2.3.99pre8+lock/drivers/sgi/char/shmiq.c
--- linux-2.3.99pre8-linus/drivers/sgi/char/shmiq.c Sun Mar 12 12:03:13 2000
+++ linux-2.3.99pre8+lock/drivers/sgi/char/shmiq.c Sat May 20 03:34:14 2000
@@ -118,8 +118,7 @@
e->data.device, e->data.which, e->data.type, e->data.flags);
s->tail = tail_next;
shmiqs [device].tail = tail_next;
- if (shmiqs [device].fasync)
- kill_fasync (shmiqs [device].fasync, SIGIO, POLL_IN);
+ tty_send_fasync(&shmiqs[device].fasync);
wake_up_interruptible (&shmiqs [device].proc_list);
}
diff -urNX ../exclude linux-2.3.99pre8-linus/drivers/telephony/ixj.c linux-2.3.99pre8+lock/drivers/telephony/ixj.c
--- linux-2.3.99pre8-linus/drivers/telephony/ixj.c Thu Mar 16 02:05:36 2000
+++ linux-2.3.99pre8+lock/drivers/telephony/ixj.c Sat May 20 03:28:40 2000
@@ -446,8 +446,7 @@
{
j->m_hook = 0;
j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ tty_send_fasync(&j->async_queue); // Send apps notice of change
}
goto timer_end;
}
@@ -536,8 +535,7 @@
j->proc_load = j->ssr.high << 8 | j->ssr.low;
if (!j->m_hook) {
j->m_hook = j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ tty_send_fasync(&j->async_queue); // Send apps notice of change
}
} else {
if (j->dsp.low == 0x21 &&
@@ -552,8 +550,7 @@
if (j->m_hook) {
j->m_hook = 0;
j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ tty_send_fasync(&j->async_queue); // Send apps notice of change
}
}
}
@@ -642,8 +639,7 @@
}
if (j->ex.bytes) {
wake_up_interruptible(&j->poll_q); // Wake any blocked selects
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ tty_send_fasync(&j->async_queue); // Send apps notice of change
}
} else {
break;
@@ -917,8 +913,7 @@
j->r_hook = fOffHook;
if (j->port != PORT_POTS) {
j->ex.bits.hookstate = 1;
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of change
+ tty_send_fasync(&j->async_queue); // Send apps notice of change
}
}
@@ -1471,8 +1466,7 @@
wake_up_interruptible(&j->poll_q); // Wake any blocked selects
- if (j->async_queue)
- kill_fasync(j->async_queue, SIGIO, POLL_IN); // Send apps notice of frame
+ tty_send_fasync(&j->async_queue); // Send apps notice of frame
}
}
@@ -1557,8 +1551,7 @@
wake_up_interruptible(&j->poll_q); // Wake any blocked selects