From e35ee4b6046b85c4d60f31ea79bde400c89d7a90 Mon Sep 17 00:00:00 2001 From: limingkang Date: Fri, 3 Feb 2023 15:49:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: limingkang Change-Id: I14f2b6edc141eea520051856211b873463271167 --- services/modules/reboot/reboot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/modules/reboot/reboot.c b/services/modules/reboot/reboot.c index fac1d650..d4610caf 100644 --- a/services/modules/reboot/reboot.c +++ b/services/modules/reboot/reboot.c @@ -62,8 +62,11 @@ static int DoRebootPanic(int id, const char *name, int argc, const char **argv) if (panic == NULL) { return reboot(RB_AUTOBOOT); } - fwrite((void *)"c", 1, 1, panic); - fclose(panic); + if (fwrite((void *)"c", 1, 1, panic) != 1) { + (void)fclose(panic); + PLUGIN_LOGI("fwrite to panic failed"); + } + (void)fclose(panic); #endif return 0; } -- GitLab