init: Check chroot return value in sysupgrade_exec_upgraded()
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 15 Jul 2017 17:51:20 +0000 (10:51 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Thu, 20 Jul 2017 15:30:06 +0000 (08:30 -0700)
commit85ccb95c1110ad7c08d918f39f7930aab38d56f8
tree6ab028cfcf80e6a568dec54ad9102a4fa523e1fa
parent76dcbee7fd3a90221619feb7e4c572e00b60af9b
init: Check chroot return value in sysupgrade_exec_upgraded()

chroot() can fail and its return value should be checked against, in that case
do an exit() since this is a fatal condition that we cannot recover from.

Fixes: 63789e51ed91 ("init: add support for sysupgrades triggered from preinit")
Reviewed-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
sysupgrade.c