[alsa-devel] [PATCH 1/2] aplay: Show usage if no parameter is passed

Clemens Ladisch clemens at ladisch.de
Mon Nov 12 23:04:41 CET 2012


Fabio Estevam wrote:
> When aplay/arecord are called without any argument the application hangs forever.
>
> Instead of hanging, print the usage and exit.
>
> +	if (argc == 1) {
> +		usage(command);
> +		return 0;
> +	}

It's possible to call it with "aplay < somefile".
Better add a check like isatty(fileno(stdin)).


Regards,
Clemens


More information about the Alsa-devel mailing list