From: Matthias Schiffer Date: Thu, 20 Jul 2017 19:35:14 +0000 (+0200) Subject: system: return ubus error when sysupgrade_exec_upgraded() has failed X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=17026f4683b2a99085779e6bec3a2e67479089e0;p=oweals%2Fprocd.git 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 --- 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