From 2b067844c3e57c15693abb2b5875e6d41dcab8a9 Mon Sep 17 00:00:00 2001 From: vdutta Date: Wed, 15 Feb 2023 14:54:07 +0530 Subject: [PATCH] Wait before exit, in case of reboot or factory reset --- src/common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 9fc6ada..856c5f1 100755 --- a/src/common.c +++ b/src/common.c @@ -325,7 +325,9 @@ void cwmp_reboot(char *command_key) blob_buf_free(&b); - sleep(5); + // Wait before exit to avoid getting restarted by procd + sleep(300); + CWMP_LOG(ERROR, "# Problem in system restart #"); } /* @@ -340,6 +342,10 @@ void cwmp_factory_reset() //use the ubus rpc-sys factory icwmp_ubus_invoke("rpc-sys", "factory", b.head, NULL, NULL); blob_buf_free(&b); + + // Wait before exit to avoid getting restarted by procd + sleep(300); + CWMP_LOG(ERROR, "# Problem in system factory reset #"); } long int get_file_size(char *file_name)