>From 9b04b5ab4d4e963aef630fa96f84e1c433c49476 Mon Sep 17 00:00:00 2001 From: Ferenc Wagner Date: Tue, 17 Nov 2009 23:37:02 +0100 Subject: [PATCH] Add the 'always cancel' parameter --- resume.c | 5 +++++ suspend.c | 12 ++++++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/resume.c b/resume.c index 50ea2c8..4b70fe4 100644 --- a/resume.c +++ b/resume.c @@ -148,6 +148,11 @@ static struct config_par parameters[] = { .fmt = "%c", .ptr = NULL, }, + { + .name = "always cancel", + .fmt = "%c", + .ptr = NULL, + }, #ifdef CONFIG_THREADS { .name = "threads", diff --git a/suspend.c b/suspend.c index 6a7dbb4..2dc1311 100644 --- a/suspend.c +++ b/suspend.c @@ -96,6 +96,7 @@ static enum { } shutdown_method = SHUTDOWN_METHOD_PLATFORM; static int resume_pause; static char verify_image; +static char always_cancel; #ifdef CONFIG_THREADS static char use_threads; #else @@ -204,6 +205,11 @@ static struct config_par parameters[] = { .fmt = "%c", .ptr = &verify_image, }, + { + .name = "always cancel", + .fmt = "%c", + .ptr = &always_cancel, + }, #ifdef CONFIG_THREADS { .name = "threads", @@ -1373,6 +1379,9 @@ static int save_image(struct swap_writer *handle, unsigned int nr_pages) if (abort_possible) splash.restore_abort(&savedtrm); + if (always_cancel) + error = -EINTR; + return error; } @@ -2339,6 +2348,9 @@ int main(int argc, char *argv[]) if (verify_image != 'y' && verify_image != 'Y') verify_image = 0; + if (always_cancel != 'y' && always_cancel != 'Y') + always_cancel = 0; + #ifdef CONFIG_THREADS if (use_threads != 'y' && use_threads != 'Y') use_threads = 0; -- 1.5.6.5