patch-2.4.27 linux-2.4.27/net/wanrouter/wanproc.c
Next file: linux-2.4.27/CREDITS
Previous file: linux-2.4.27/net/sctp/ulpqueue.c
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
2004-08-07 16:26:07.116447942 -0700
- Orig file:
linux-2.4.26/net/wanrouter/wanproc.c
- Orig date:
2001-09-10 07:58:35.000000000 -0700
diff -urN linux-2.4.26/net/wanrouter/wanproc.c linux-2.4.27/net/wanrouter/wanproc.c
@@ -243,7 +243,9 @@
struct inode *inode = file->f_dentry->d_inode;
struct proc_dir_entry* dent;
char* page;
- int pos, offs, len;
+ int pos, len;
+ loff_t n = *ppos;
+ unsigned offs = n;
if (count <= 0)
return 0;
@@ -257,14 +259,13 @@
return -ENOBUFS;
pos = dent->get_info(page, dent->data, 0, 0);
- offs = file->f_pos;
- if (offs < pos) {
+ if (offs == n && offs < pos) {
len = min_t(unsigned int, pos - offs, count);
if (copy_to_user(buf, (page + offs), len)) {
kfree(page);
return -EFAULT;
}
- file->f_pos += len;
+ *ppos = offs + len;
}
else
len = 0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)