patch-2.4.27 linux-2.4.27/fs/proc/proc_misc.c
Next file: linux-2.4.27/fs/reiserfs/journal.c
Previous file: linux-2.4.27/fs/proc/kcore.c
Back to the patch index
Back to the overall index
- Lines: 25
- Date:
2004-08-07 16:26:06.016402742 -0700
- Orig file:
linux-2.4.26/fs/proc/proc_misc.c
- Orig date:
2003-11-28 10:26:21.000000000 -0800
diff -urN linux-2.4.26/fs/proc/proc_misc.c linux-2.4.27/fs/proc/proc_misc.c
@@ -500,12 +500,13 @@
static ssize_t read_profile(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
- unsigned long p = *ppos;
+ loff_t n = *ppos;
+ unsigned p = n;
ssize_t read;
char * pnt;
unsigned int sample_step = 1 << prof_shift;
- if (p >= (prof_len+1)*sizeof(unsigned int))
+ if (p != n || p >= (prof_len+1)*sizeof(unsigned int))
return 0;
if (count > (prof_len+1)*sizeof(unsigned int) - p)
count = (prof_len+1)*sizeof(unsigned int) - p;
@@ -519,7 +520,7 @@
if (copy_to_user(buf,(void *)pnt,count))
return -EFAULT;
read += count;
- *ppos += read;
+ *ppos = n + read;
return read;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)