public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Marcin Tolysz" <tolysz@gmail.com>
To: "Siarhei Siamashka" <siarhei.siamashka@nokia.com>
Cc: "ext Christian Hoene" <hoene@uni-tuebingen.de>,
	"Luiz Augusto von Dentz" <luiz.dentz@gmail.com>,
	"Marcel Holtmann" <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] SBC Encoder program
Date: Mon, 5 Jan 2009 20:36:35 +0000	[thread overview]
Message-ID: <54bbe4e00901051236i305cd062w513093bb24bf7c1e@mail.gmail.com> (raw)
In-Reply-To: <200901051522.25993.siarhei.siamashka@nokia.com>

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

  parent reply	other threads:[~2009-01-05 20:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200812301246.25781.siarhei.siamashka@nokia.com>
2009-01-01 14:24 ` SBC encoder conformance test for version 4.25 passed! Christian Hoene
2009-01-05  8:27   ` Siarhei Siamashka
2009-01-05 11:43     ` [PATCH] SBC Encoder program Christian Hoene
2009-01-05 12:22       ` Luiz Augusto von Dentz
2009-01-05 12:28         ` Christian Hoene
2009-01-05 13:13           ` Luiz Augusto von Dentz
2009-01-05 14:42             ` Christian Hoene
2009-01-05 14:48               ` Siarhei Siamashka
2009-01-05 13:22           ` Siarhei Siamashka
2009-01-05 14:42             ` Christian Hoene
2009-01-05 15:18               ` Siarhei Siamashka
2009-01-05 15:24                 ` Siarhei Siamashka
2009-01-05 15:33                 ` Christian Hoene
2009-01-05 17:39                   ` Siarhei Siamashka
2009-01-05 19:45                 ` Marcin Tolysz
2009-01-05 21:11                 ` David Sainty
2009-01-05 20:36             ` Marcin Tolysz [this message]
2009-01-06  2:43           ` Marcel Holtmann
2009-01-05 12:53     ` SBC encoder conformance test for version 4.25 passed! Luiz Augusto von Dentz
2009-07-15 14:49       ` Is it possible that user change a stream path between Speaker and Bluetooth like normal phone? Chan-Yeol Park
2009-07-15 15:27         ` Bastien Nocera
2009-01-05 14:55     ` SBC encoder conformance test for version 4.25 passed! Christian Hoene
2009-01-05 15:32       ` Siarhei Siamashka
2009-01-06  0:40     ` Nick Pelly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54bbe4e00901051236i305cd062w513093bb24bf7c1e@mail.gmail.com \
    --to=tolysz@gmail.com \
    --cc=hoene@uni-tuebingen.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=siarhei.siamashka@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox