Marcus Sundberg <[EMAIL PROTECTED]> wrote:

> > > ioctl(3, 0x400c0514, 0xbffffc3c)        = 0
> > > ioctl(3, 0x400c0530, 0xbffffc3c)        = -83886082

> Seems there was a bug in the kgicon layer, simply passing the
> return value from the driver on to userspace. The following
> diff fixes that:

STOP ! One cannot send differentiated return codes with that diff !
I.e. you only ever get O.K. or EINVAL, no chance to give a better suited
code.

> -                              && (kgifb_display.cmd[type]))
> -                               ? kgifb_display.cmd[type](&kgifb_graph,
> -                                                         cmd, arg)
> -                               : -EINVAL;
> -                       if ((cmd & IOC_OUT) && (res == EOK)) {
> +                              && (kgifb_display.cmd[type])
> +                              && kgifb_display.cmd[type](&kgifb_graph,
> +                                                         cmd, arg) == 0)
> +                               ? 0 : -EINVAL;
> +                       if ((cmd & IOC_OUT) && (res == 0)) {

> Sure it is. The manpage documents the library API, while strace shows
> syscalls.

It is correct to give back the KGI subsystem return code. Please reverse
that patch. If the ioctl library call does not behave like it is documented,
this is a bug in libc, and not in our drivers. For the Linux kernel ioctl 
layer it is the correct behaviour to return negative values to indicate
errors, which should make libc return -1 and set errno.

CU, ANdy

-- 
= Andreas Beck                    |  Email :  <[EMAIL PROTECTED]> =

Reply via email to