lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 11/35] [Suspend2] Set the filewriter signature to say we have an image.
Date
Given a pointer to a buffer containng the filewriter signature, modify it
so that it will be recognised as an image that we haven't attempted to
resume from before.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

kernel/power/suspend_file.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
index d5f0310..002f73c 100644
--- a/kernel/power/suspend_file.c
+++ b/kernel/power/suspend_file.c
@@ -385,3 +385,18 @@ int parse_signature(struct filewriter_he
return 1;
}

+/* prepare_signature */
+
+static int prepare_signature(struct filewriter_header *current_header,
+ unsigned long first_header_block)
+{
+ /*
+ * Explicitly put the \0 that clears the 'tried to resume from
+ * this image before' flag.
+ */
+ strncpy(current_header->sig, HaveImage, sizeof(HaveImage));
+ current_header->resumed_before = 0;
+ current_header->first_header_block = first_header_block;
+ return 0;
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 01:03    [W:0.137 / U:0.024 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site