13 Nov
2012
13 Nov
'12
12:06 p.m.
When aplay/arecord are called without any argument the application hangs forever.
Instead of hanging, print the usage and exit.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- Changes since v1: - Also check for isatty, so that 'aplay < file.wav' can still work
aplay/aplay.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/aplay/aplay.c b/aplay/aplay.c index 741979a..38459e6 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -519,6 +519,11 @@ int main(int argc, char *argv[]) return 1; }
+ if (isatty(fileno(stdin)) && (argc == 1)) { + usage(command); + return 0; + } + chunk_size = -1; rhwparams.format = DEFAULT_FORMAT; rhwparams.rate = DEFAULT_SPEED;
--
1.7.9.5