From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH v2] aplay: Introduce and use xwrite helper Date: Mon, 10 Apr 2017 09:12:25 +0200 Message-ID: References: <1491807873-29557-1-git-send-email-daniel.baluta@nxp.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 9E59A266B6D for ; Mon, 10 Apr 2017 09:12:26 +0200 (CEST) In-Reply-To: <1491807873-29557-1-git-send-email-daniel.baluta@nxp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Daniel Baluta Cc: alsa-devel@alsa-project.org, shengjiu.wang@nxp.com, o-takashi@sakamocchi.jp, broonie@kernel.org, viorel.suman@nxp.com, mihai.serban@nxp.com List-Id: alsa-devel@alsa-project.org On Mon, 10 Apr 2017 09:04:33 +0200, Daniel Baluta wrote: > > Write can return less then requested bytes, but we treat this as > an error thus ending up with confusing error messages. > > Fix this by introducing xwrite helper, which makes sure all bytes > are written or an error is returned. > > With this patch an usecase where disk is filled by recording will > print: > $ /mnt/msc/audio.wav: No space left on device > > instead of random messages like: > > $/mnt/msc/audio.wav: No such file or directory > > Signed-off-by: Daniel Baluta > --- > Changes since v1: > * return the correct number of bytes Applied, thanks. Takashi