2002-10-06 17:23:30

by Alan Cox

[permalink] [raw]
Subject: PATCH: make jffs/jffs2 work with signal changes

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.2.5.40/fs/jffs/intrep.c linux.2.5.40-ac5/fs/jffs/intrep.c
--- linux.2.5.40/fs/jffs/intrep.c 2002-10-02 21:34:06.000000000 +0100
+++ linux.2.5.40-ac5/fs/jffs/intrep.c 2002-10-04 15:39:36.000000000 +0100
@@ -3376,10 +3376,13 @@
*/
while (signal_pending(current)) {
siginfo_t info;
- unsigned long signr;
+ unsigned long signr = 0;

spin_lock_irq(&current->sig->siglock);
- signr = dequeue_signal(&current->blocked, &info);
+ if (current->sig->shared_pending.head)
+ signr = dequeue_signal(&current->sig->shared_pending, &current->blocked, &info);
+ if (!signr)
+ signr = dequeue_signal(&current->pending, &current->blocked, &info);
spin_unlock_irq(&current->sig->siglock);

switch(signr) {
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.2.5.40/fs/jffs2/background.c linux.2.5.40-ac5/fs/jffs2/background.c
--- linux.2.5.40/fs/jffs2/background.c 2002-10-02 21:34:06.000000000 +0100
+++ linux.2.5.40-ac5/fs/jffs2/background.c 2002-10-04 15:46:29.000000000 +0100
@@ -112,10 +112,13 @@
*/
while (signal_pending(current)) {
siginfo_t info;
- unsigned long signr;
+ unsigned long signr = 0 ;

spin_lock_irq(&current->sig->siglock);
- signr = dequeue_signal(&current->blocked, &info);
+ if (current->sig->shared_pending.head)
+ signr = dequeue_signal(&current->sig->shared_pending, &current->blocked, &info);
+ if (!signr)
+ signr = dequeue_signal(&current->pending, &current->blocked, &info);
spin_unlock_irq(&current->sig->siglock);

switch(signr) {