X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fisdn%2Fhysdn%2Fhysdn_proclog.c;h=4211cd0424be157bc6ad50877a280b4dbc9c1ee4;hb=5e3b93f248c98873cc843e83092bb8da92ac85a2;hp=8ef2b7c952a67d5e7d2195024f739e52bdab0223;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index 8ef2b7c95..4211cd042 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -150,7 +150,7 @@ put_log_buffer(hysdn_card * card, char *cp) /* write log file -> set log level bits */ /****************************************/ static ssize_t -hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off) +hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off) { ulong u = 0; int found = 0; @@ -158,6 +158,9 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t long base = 10; hysdn_card *card = (hysdn_card *) file->private_data; + if (&file->f_pos != off) /* fs error check */ + return (-ESPIPE); + if (count > (sizeof(valbuf) - 1)) count = sizeof(valbuf) - 1; /* limit length */ if (copy_from_user(valbuf, buf, count)) @@ -200,7 +203,7 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t /* read log file */ /******************/ static ssize_t -hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t * off) +hysdn_log_read(struct file *file, char *buf, size_t count, loff_t * off) { struct log_data *inf; int len; @@ -234,7 +237,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t * off) if ((len = strlen(inf->log_start)) <= count) { if (copy_to_user(buf, inf->log_start, len)) return -EFAULT; - *off += len; + file->f_pos += len; return (len); } return (0); @@ -282,7 +285,7 @@ hysdn_log_open(struct inode *ino, struct file *filep) return (-EPERM); /* no permission this time */ } unlock_kernel(); - return nonseekable_open(ino, filep); + return (0); } /* hysdn_log_open */ /*******************************************************************************/