sandbox: Fix quiting when the LCD window is closed

With recent changes to how sandbox handles reset, closing the window
currently just restarts sandbox.

Use the correct sysreset type to tell it to shut down.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2023-06-01 10:22:28 -06:00 committed by Tom Rini
parent def898c458
commit 06d3414ac7

View file

@ -6,6 +6,7 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdbool.h> #include <stdbool.h>
#include <sysreset.h>
#include <linux/input.h> #include <linux/input.h>
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
#include <asm/state.h> #include <asm/state.h>
@ -81,7 +82,7 @@ static void sandbox_sdl_poll_events(void)
switch (event.type) { switch (event.type) {
case SDL_QUIT: case SDL_QUIT:
puts("LCD window closed - quitting\n"); puts("LCD window closed - quitting\n");
reset_cpu(); sysreset_walk(SYSRESET_POWER_OFF);
break; break;
} }
} }