X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fwatchdog%2Fpcwd_pci.c;h=ddfeee87875126a23e9c818850f45529f7ca4729;hb=4df52aa9a6dd8cb5fff67da03cdfa58a3c607912;hp=7216e4836193fd87b1d77266f4ad516c8bde6518;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c index 7216e4836..ddfeee878 100644 --- a/drivers/char/watchdog/pcwd_pci.c +++ b/drivers/char/watchdog/pcwd_pci.c @@ -261,6 +261,10 @@ static int pcipcwd_get_temperature(int *temperature) static ssize_t pcipcwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + /* See if we got the magic character 'V' and reload the timer */ if (len) { if (!nowayout) { @@ -388,7 +392,7 @@ static int pcipcwd_open(struct inode *inode, struct file *file) /* Activate */ pcipcwd_start(); pcipcwd_keepalive(); - return nonseekable_open(inode, file); + return 0; } static int pcipcwd_release(struct inode *inode, struct file *file) @@ -416,6 +420,10 @@ static ssize_t pcipcwd_temp_read(struct file *file, char __user *data, { int temperature; + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + if (pcipcwd_get_temperature(&temperature)) return -EFAULT; @@ -430,7 +438,7 @@ static int pcipcwd_temp_open(struct inode *inode, struct file *file) if (!pcipcwd_private.supports_temp) return -ENODEV; - return nonseekable_open(inode, file); + return 0; } static int pcipcwd_temp_release(struct inode *inode, struct file *file)