autoupdater: avoid additional shell process
This commit is contained in:
parent
d3bc159bf8
commit
03bfd9f779
|
@ -380,10 +380,12 @@ static bool autoupdate(const char *mirror, struct settings *s, int lock_fd) {
|
|||
|
||||
/* Test the image upgrade (issue #193) */
|
||||
{
|
||||
static const char *const exec_builtin = "exec ";
|
||||
static const char *const test_option = " --test ";
|
||||
|
||||
char buf[strlen(sysupgrade_path) + strlen(test_option) + strlen(firmware_path) + 1];
|
||||
strcpy(buf, sysupgrade_path);
|
||||
char buf[strlen(exec_builtin) + strlen(sysupgrade_path) + strlen(test_option) + strlen(firmware_path) + 1];
|
||||
strcpy(buf, exec_builtin);
|
||||
strcat(buf, sysupgrade_path);
|
||||
strcat(buf, test_option);
|
||||
strcat(buf, firmware_path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue