]> git.alsa-project.org Git - alsa-utils.git/commit
aplay: Introduce and use xwrite helper
authorDaniel Baluta <daniel.baluta@nxp.com>
Mon, 10 Apr 2017 07:04:33 +0000 (10:04 +0300)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Apr 2017 07:11:28 +0000 (09:11 +0200)
commit1d34e6addc22048ea829a7967e703cf38166cfde
tree166a6cdb24ec1eb98b92c7ff1cf7378f58e503d4
parent1314abd2d61877a92e5289452dee308e98dab0c1
aplay: Introduce and use xwrite helper

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 <daniel.baluta@nxp.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
aplay/aplay.c