diff mbox series

Lua: replace puts() by ERROR()

Message ID 20181029064525.14270-1-christian.storm@siemens.com
State Accepted
Headers show
Series Lua: replace puts() by ERROR() | expand

Commit Message

Storm, Christian Oct. 29, 2018, 6:45 a.m. UTC
Route the Lua error properly through SWUpdate's
logging infrastructure instead of stdout.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 corelib/lua_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Babic Oct. 30, 2018, 2:08 p.m. UTC | #1
On 29/10/18 07:45, Christian Storm wrote:
> Route the Lua error properly through SWUpdate's
> logging infrastructure instead of stdout.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  corelib/lua_interface.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
> index 94fc981..30fb909 100644
> --- a/corelib/lua_interface.c
> +++ b/corelib/lua_interface.c
> @@ -926,8 +926,8 @@ static int l_handler_wrapper(struct img_type *img, void *data) {
>  	image2table(gL, img);
>  
>  	if (LUA_OK != (res = lua_pcall(gL, 1, 1, 0))) {
> -		ERROR("error while executing the Lua callback: %d",res);
> -		puts(lua_tostring(gL, -1));
> +		ERROR("Error %d while executing the Lua callback: %s",
> +			  res, lua_tostring(gL, -1));
>  		return -1;
>  	}
>  
> 
Applied to -master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
index 94fc981..30fb909 100644
--- a/corelib/lua_interface.c
+++ b/corelib/lua_interface.c
@@ -926,8 +926,8 @@  static int l_handler_wrapper(struct img_type *img, void *data) {
 	image2table(gL, img);
 
 	if (LUA_OK != (res = lua_pcall(gL, 1, 1, 0))) {
-		ERROR("error while executing the Lua callback: %d",res);
-		puts(lua_tostring(gL, -1));
+		ERROR("Error %d while executing the Lua callback: %s",
+			  res, lua_tostring(gL, -1));
 		return -1;
 	}