lkml.org 
[lkml]   [2006]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: led_class: storing a value can act but return -EINVAL
Hi!

> > Well, I'd argue current behaviour is okay... can you strace it? It
> > should accept the number (return 3) then return -EINVAL.
>
> That's exactly what happens.

And that's pretty much exactly okay.

You got success return when you wrote "255" there, then you got
-EINVAL when you tried to put newline there. Expected behaviour, I'd
say.

...I can see it looks ugly when you do echo manually, but you simply
should not do that.

> Which is totally bogus, because userspace will think that the setting
> didn't succeed. Or application authors will ignore the return value
> assuming that it always succeeded. Or read the value back to see if it
> succeeded. All icky, when we can well have a good return value.

Well, they got what they deserve, that \n does not belong there. And
they _did_ get success report -- "3" was returned. That's how unix
works, I'd say. Educate userspace authors that adding \n is bad idea.

Pavel
--
Thanks for all the (sleeping) penguins.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-30 14:14    [W:0.035 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site