diff mbox series

progress_thread: Send VERSION as valid sub-JSON in progress IPC

Message ID 20201007133210.127931-1-sava.jakovljev@teufel.de
State New
Headers show
Series progress_thread: Send VERSION as valid sub-JSON in progress IPC | expand

Commit Message

Sava Jakovljev Oct. 7, 2020, 1:32 p.m. UTC
Signed-off-by: Sava Jakovljev <sava.jakovljev@teufel.de>
---
 core/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic Oct. 12, 2020, 2:13 p.m. UTC | #1
On 07.10.20 15:32, Sava Jakovljev wrote:
> Signed-off-by: Sava Jakovljev <sava.jakovljev@teufel.de>
> ---
>  core/parser.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/parser.c b/core/parser.c
> index bc13d26..0240e9a 100644
> --- a/core/parser.c
> +++ b/core/parser.c
> @@ -242,7 +242,7 @@ int parse(struct swupdate_cfg *sw, const char *descfile)
>  	 * Send the version string as first message to progress interface
>  	 */
>  	char *versioninfo;
> -	if (asprintf(&versioninfo, "VERSION : %s", sw->version) == ENOMEM_ASPRINTF)
> +	if (asprintf(&versioninfo, "{\"VERSION\" : \"%s\"}", sw->version) == ENOMEM_ASPRINTF)

I see.

Applied to -master, thanks !

Best regards,
Stefano Babic

>  		ERROR("OOM sending version info");
>  	else
>  		swupdate_progress_info(RUN, 0, versioninfo);
>
diff mbox series

Patch

diff --git a/core/parser.c b/core/parser.c
index bc13d26..0240e9a 100644
--- a/core/parser.c
+++ b/core/parser.c
@@ -242,7 +242,7 @@  int parse(struct swupdate_cfg *sw, const char *descfile)
 	 * Send the version string as first message to progress interface
 	 */
 	char *versioninfo;
-	if (asprintf(&versioninfo, "VERSION : %s", sw->version) == ENOMEM_ASPRINTF)
+	if (asprintf(&versioninfo, "{\"VERSION\" : \"%s\"}", sw->version) == ENOMEM_ASPRINTF)
 		ERROR("OOM sending version info");
 	else
 		swupdate_progress_info(RUN, 0, versioninfo);