diff --git a/services/modules/reboot/reboot.c b/services/modules/reboot/reboot.c index fac1d6505a9b554ba029374b3010b99484a43bef..d4610caf98d705940847b30bcfb30221d05c4ed3 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; }