From 7fffaecfa225f5cf255e58c26c12cc4ed376c92f Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Mon, 28 Jan 2013 19:14:12 +0100 Subject: [PATCH] update_flash: fix 'reboot' option While on busybox' init you can reboot the system sending a TERM signal to pid '1' it seems that in sysvinit package this does not work, so implement a proper reboot using the system call. https://jira.digi.com/browse/DEL-212 #resolve Signed-off-by: Javier Viguera --- .../recipes-digi/update-flash/update-flash/update_flash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/meta-digi-del/recipes-digi/update-flash/update-flash/update_flash.c b/meta-digi-del/recipes-digi/update-flash/update-flash/update_flash.c index 34cfc2e0d..4c91ab90f 100644 --- a/meta-digi-del/recipes-digi/update-flash/update-flash/update_flash.c +++ b/meta-digi-del/recipes-digi/update-flash/update-flash/update_flash.c @@ -29,6 +29,7 @@ #include /* EXIT_SUCCESS */ #include /* memset */ #include /* close */ +#include /* reboot */ #include /* ntohl */ #include /* setmntent */ @@ -383,10 +384,7 @@ int main(int argc, char *argv[]) if (cDoReboot) { sync(); - - PRINTF("Rebooting System\n"); - /* kills init */ - kill(1, SIGTERM); + reboot(RB_AUTOBOOT); } /* may not be reached in case of kill */