From 17026f4683b2a99085779e6bec3a2e67479089e0 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 20 Jul 2017 21:35:14 +0200 Subject: [PATCH] system: return ubus error when sysupgrade_exec_upgraded() has failed When sysupgrade_exec_upgraded() is successful, it will replace procd with upgraded, so it won't ever return (making the ubus call hang forever, which is fine as stage2 will kill all processes anyways). Signed-off-by: Matthias Schiffer --- system.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system.c b/system.c index 6cd2b62..151f613 100644 --- a/system.c +++ b/system.c @@ -403,7 +403,9 @@ static int sysupgrade(struct ubus_context *ctx, struct ubus_object *obj, sysupgrade_exec_upgraded(blobmsg_get_string(tb[SYSUPGRADE_PREFIX]), blobmsg_get_string(tb[SYSUPGRADE_PATH]), tb[SYSUPGRADE_COMMAND] ? blobmsg_get_string(tb[SYSUPGRADE_COMMAND]) : NULL); - return 0; + + /* sysupgrade_exec_upgraded() will never return unless something has gone wrong */ + return UBUS_STATUS_UNKNOWN_ERROR; } static void -- 2.30.2