[RFC PATCH ubus] cli: improve error logging for call command

Petr Štetiar ynezz at true.cz
Fri Feb 18 01:56:05 PST 2022


Stijn Tintel <stijn at linux-ipv6.be> [2022-02-18 11:31:15]:

Hi,

> These messages contain absolutely no info that explains where they come
> from; it's not even clear they are coming from ubus. This makes tracking
> down what's causing them virtually impossible.

+1

> -	return ubus_invoke(ctx, id, argv[1], b.head, receive_call_result_data, NULL, timeout * 1000);
> +	ret = ubus_invoke(ctx, id, argv[1], b.head, receive_call_result_data, NULL, timeout * 1000);
> +	if (ret && !simple_output && !isatty(fileno(stderr) == ENOTTY)) {

can't you move that !simple and !isatty checks into common place like
print_error() in order to simplify such common use cases?

Other then that, feel free to add my Acked-by:

Cheers,

Petr



More information about the openwrt-devel mailing list