patch-2.1.127 linux/fs/ncpfs/sock.c

Next file: linux/fs/nfs/inode.c
Previous file: linux/fs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.126/linux/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c
@@ -94,7 +94,7 @@
 	poll_table wait_table;
 	struct poll_table_entry entry;
 	int init_timeout, max_timeout;
-	int timeout;
+	int timeout; long tmp_timeout;
 	int retrans;
 	int major_timeout_seen;
 	int acknowledge_seen;
@@ -173,6 +173,7 @@
 		wait_table.entry = &entry;
 		current->state = TASK_INTERRUPTIBLE;
 		if (!(file->f_op->poll(file, &wait_table) & POLLIN)) {
+			int timed_out;
 			if (timeout > max_timeout) {
 				/* JEJB/JSP 2/7/94
 				 * This is useful to see if the system is
@@ -182,17 +183,15 @@
 				}
 				timeout = max_timeout;
 			}
-			current->timeout = jiffies + timeout;
-			schedule();
+			timed_out = !schedule_timeout(timeout);
 			remove_wait_queue(entry.wait_address, &entry.wait);
 			fput(file);
 			current->state = TASK_RUNNING;
 			if (signal_pending(current)) {
-				current->timeout = 0;
 				result = -ERESTARTSYS;
 				break;
 			}
-			if (!current->timeout) {
+			if (timed_out) {
 				if (n < retrans)
 					continue;
 				if (server->m.flags & NCP_MOUNT_SOFT) {
@@ -208,8 +207,7 @@
 				}
 				major_timeout_seen = 1;
 				continue;
-			} else
-				current->timeout = 0;
+			}
 		} else if (wait_table.nr) {
 			remove_wait_queue(entry.wait_address, &entry.wait);
 			fput(file);

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