patch-2.4.25 linux-2.4.25/arch/ppc64/kernel/scanlog.c
Next file: linux-2.4.25/arch/ppc64/kernel/setup.c
Previous file: linux-2.4.25/arch/ppc64/kernel/rtc.c
Back to the patch index
Back to the overall index
- Lines: 29
- Date:
2004-02-18 05:36:30.000000000 -0800
- Orig file:
linux-2.4.24/arch/ppc64/kernel/scanlog.c
- Orig date:
2003-06-13 07:51:32.000000000 -0700
diff -urN linux-2.4.24/arch/ppc64/kernel/scanlog.c linux-2.4.25/arch/ppc64/kernel/scanlog.c
@@ -129,17 +129,25 @@
static ssize_t scanlog_write(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
+ char stkbuf[20];
unsigned long status;
+ if (count > 19)
+ count = 19;
+ if (copy_from_user (stkbuf, buf, count))
+ return -EFAULT;
+
+ stkbuf[count] = 0;
+
if (buf) {
- if (strncmp(buf, "reset", 5) == 0) {
+ if (strncmp(stkbuf, "reset", 5) == 0) {
DEBUG("reset scanlog\n");
status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, NULL, 0);
DEBUG("rtas returns %ld\n", status);
- } else if (strncmp(buf, "debugon", 7) == 0) {
+ } else if (strncmp(stkbuf, "debugon", 7) == 0) {
printk(KERN_ERR "scanlog: debug on\n");
scanlog_debug = 1;
- } else if (strncmp(buf, "debugoff", 8) == 0) {
+ } else if (strncmp(stkbuf, "debugoff", 8) == 0) {
printk(KERN_ERR "scanlog: debug off\n");
scanlog_debug = 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)