This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / char / dtlk.c
index e8f15f4..e6ad246 100644 (file)
@@ -128,6 +128,10 @@ static ssize_t dtlk_read(struct file *file, char __user *buf,
        char ch;
        int i = 0, retries;
 
+       /* Can't seek (pread) on the DoubleTalk.  */
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
+
        TRACE_TEXT("(dtlk_read");
        /*  printk("DoubleTalk PC - dtlk_read()\n"); */
 
@@ -176,6 +180,10 @@ static ssize_t dtlk_write(struct file *file, const char __user *buf,
        }
 #endif
 
+       /* Can't seek (pwrite) on the DoubleTalk.  */
+       if (ppos != &file->f_pos)
+               return -ESPIPE;
+
        if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
                return -EINVAL;
 
@@ -295,12 +303,11 @@ static int dtlk_open(struct inode *inode, struct file *file)
 {
        TRACE_TEXT("(dtlk_open");
 
-       nonseekable_open(inode, file);
        switch (iminor(inode)) {
        case DTLK_MINOR:
                if (dtlk_busy)
                        return -EBUSY;
-               return nonseekable_open(inode, file);
+               return 0;
 
        default:
                return -ENXIO;