VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / isdn / hysdn / hysdn_proclog.c
index 4211cd0..8ef2b7c 100644 (file)
@@ -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 *buf, size_t count, loff_t * off)
+hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
 {
        ulong u = 0;
        int found = 0;
@@ -158,9 +158,6 @@ hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off)
        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))
@@ -203,7 +200,7 @@ hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off)
 /* read log file */
 /******************/
 static ssize_t
-hysdn_log_read(struct file *file, char *buf, size_t count, loff_t * off)
+hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t * off)
 {
        struct log_data *inf;
        int len;
@@ -237,7 +234,7 @@ hysdn_log_read(struct file *file, char *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;
-               file->f_pos += len;
+               *off += len;
                return (len);
        }
        return (0);
@@ -285,7 +282,7 @@ hysdn_log_open(struct inode *ino, struct file *filep)
                return (-EPERM);        /* no permission this time */
        }
        unlock_kernel();
-       return (0);
+       return nonseekable_open(ino, filep);
 }                              /* hysdn_log_open */
 
 /*******************************************************************************/