X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fwatchdog%2Fwdt.c;h=407690ba01f4f718bb9d38388c008da108c1525d;hb=5e3b93f248c98873cc843e83092bb8da92ac85a2;hp=5684aa37988611d4525824d5e6401ee70426a9f8;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c index 5684aa379..407690ba0 100644 --- a/drivers/char/watchdog/wdt.c +++ b/drivers/char/watchdog/wdt.c @@ -288,6 +288,10 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs) static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + if(count) { if (!nowayout) { size_t i; @@ -393,7 +397,7 @@ static int wdt_open(struct inode *inode, struct file *file) * Activate */ wdt_start(); - return nonseekable_open(inode, file); + return 0; } /** @@ -437,6 +441,10 @@ static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, { int temperature; + /* Can't seek (pread) on this device */ + if (ptr != &file->f_pos) + return -ESPIPE; + if (wdt_get_temperature(&temperature)) return -EFAULT; @@ -456,7 +464,7 @@ static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, static int wdt_temp_open(struct inode *inode, struct file *file) { - return nonseekable_open(inode, file); + return 0; } /**