system: return ubus error when sysupgrade_exec_upgraded() has failed
authorMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 20 Jul 2017 19:35:14 +0000 (21:35 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 20 Jul 2017 19:38:31 +0000 (21:38 +0200)
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 <mschiffer@universe-factory.net>
system.c

index 6cd2b624b3be9e88db52e04fb26ea1f9286b3c22..151f613002369de61194434c692339aae8618aa9 100644 (file)
--- 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