Re: [PATCH v2] aplay: Fix error message when writing captured data

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

 



On Fri, Apr 7, 2017 at 4:27 PM, Takashi Iwai <tiwai@xxxxxxx> wrote:
> On Fri, 07 Apr 2017 15:20:36 +0200,
> Daniel Baluta wrote:
>>
>> Read can return less then requested bytes, but we treat
>> this as an error.
>
s/read/write here :)).

> Actually that's the bug -- we should loop the write until it reaches
> to the real error.  Once when we get the proper errno, the error
> message via perror() itself will be enough.

Correct. But I think aplay decided to keep things simple and fail in case
couldn't write all requested bytes.

This pattern can be noticed all over the places where write is used.

Given the fact that write is blocking (meaning that it must write
at least one byte until return) this should work most of the time,
excepting corner cases like disk full, etc.

thanks,
Daniel.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux