Signed-off-by: Nicolas Kaiser <[email protected]>
---
It looks to me like -ENODEV might not be a good return value
in poll(). Would POLLERR be the correct one in this case?
kernel/time/posix-clock.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index c340ca6..2424d3f 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -71,7 +71,7 @@ static unsigned int posix_clock_poll(struct file *fp, poll_table *wait)
int result = 0;
if (!clk)
- return -ENODEV;
+ return POLLERR;
if (clk->ops.poll)
result = clk->ops.poll(clk, fp, wait);
--
1.7.5.rc3
On Tue, May 24, 2011 at 12:51:47PM +0200, Nicolas Kaiser wrote:
> Signed-off-by: Nicolas Kaiser <[email protected]>
> ---
> It looks to me like -ENODEV might not be a good return value
> in poll(). Would POLLERR be the correct one in this case?
>
> kernel/time/posix-clock.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
> index c340ca6..2424d3f 100644
> --- a/kernel/time/posix-clock.c
> +++ b/kernel/time/posix-clock.c
> @@ -71,7 +71,7 @@ static unsigned int posix_clock_poll(struct file *fp, poll_table *wait)
> int result = 0;
>
> if (!clk)
> - return -ENODEV;
> + return POLLERR;
The condition (!clk) is only satisfied when 'zombie' is set,
indicating that the dynamic clock has disappeared. That is why the
file operations uniformly return ENODEV. So, I think it makes sense
the way that it is.
In addition, man 2 poll says,
POLLERR
Error condition (output only).
so using that error code would be misleading, IMHO.
Thanks,
Richard
* Richard Cochran <[email protected]>:
> On Tue, May 24, 2011 at 12:51:47PM +0200, Nicolas Kaiser wrote:
> > It looks to me like -ENODEV might not be a good return value
> > in poll(). Would POLLERR be the correct one in this case?
> The condition (!clk) is only satisfied when 'zombie' is set,
> indicating that the dynamic clock has disappeared. That is why the
> file operations uniformly return ENODEV. So, I think it makes sense
> the way that it is.
>
> In addition, man 2 poll says,
>
> POLLERR
> Error condition (output only).
>
> so using that error code would be misleading, IMHO.
I see. Sorry for the noise.
Best regards,
Nicolas Kaiser