patch-2.4.27 linux-2.4.27/arch/ia64/kernel/salinfo.c
Next file: linux-2.4.27/arch/ia64/kernel/unwind.c
Previous file: linux-2.4.27/arch/ia64/kernel/perfmon.c
Back to the patch index
Back to the overall index
- Lines: 30
- Date:
2004-08-07 16:26:04.574343490 -0700
- Orig file:
linux-2.4.26/arch/ia64/kernel/salinfo.c
- Orig date:
2004-04-14 06:05:26.000000000 -0700
diff -urN linux-2.4.26/arch/ia64/kernel/salinfo.c linux-2.4.27/arch/ia64/kernel/salinfo.c
@@ -451,6 +451,7 @@
size_t size;
u8 *buf;
u64 bufsize;
+ loff_t pos = *ppos;
if (data->state == STATE_LOG_RECORD) {
buf = data->log_buffer;
@@ -462,17 +463,17 @@
buf = NULL;
bufsize = 0;
}
- if (*ppos >= bufsize)
+ if (pos != (unsigned)pos || pos >= bufsize)
return 0;
- saldata = buf + file->f_pos;
- size = bufsize - file->f_pos;
+ saldata = buf + pos;
+ size = bufsize - pos;
if (size > count)
size = count;
if (copy_to_user(buffer, saldata, size))
return -EFAULT;
- *ppos += size;
+ *ppos = pos + size;
return size;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)