Re: [PATCH] SBC Encoder program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I want to apologize  for my previous post :)

If what you want is to know is if there was an error & how much you red?
that it might not work as you cann't return two value at once (not this way).

But if you want to now if there was an error on first reading?

> @@ -47,7 +47,7 @@ static ssize_t __read(int fd, void *buf, size_t count)
>         while (count > 0) {
>                 len = read(fd, buf + pos, count);
>                 if (len <= 0)
-> -                       return len;
-> +                       return pos > len ? pos : len;
+                        return pos > 0 ? pos : len;
>
>                 count -= len;
>                 pos   += len;
this will return error code on first reading and the position
successfully red (i.e. before the error) on sequent readings. (all
assuming that pos==on entry)

You probably do not want to know the variant with position(=0) on the
first reading and error code on subsequent(before your patch)

Before your patch it was an error code all the time
After your patch it was the position all the time

Best Wishes
Marcin Tolysz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux