[PATCH] Add the 'always cancel' parameter

From: Ferenc Wagner
Date: Tue Nov 17 2009 - 17:37:02 EST


---
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


--=-=-=--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/