After a recompile of the kernel (to implement other functions) this
popped up again, so I reworked the patched to tidy a few things up, per
this discussion:
http://osdir.com/ml/linux.kernel.suspend.devel/2007-06/msg00082.html
Here is the new version of the patch:
--- resume.c 2008-09-07 15:32:10.000000000 -0400
+++ resume.c.new 2008-09-07 15:32:10.000000000 -0400
@@ -844,7 +844,12 @@
int dev, resume_dev;
int n, error, orig_loglevel;
static struct swsusp_header swsusp_header;
-
+
+ // Grace period variables
+ int loopcnt;
+ #define STAT_TIMEOUT 1000000 // 1 tenth of a second
+ #define STAT_LOOP_STEPS 300 // 30 seconds
+
my_name = basename(argv[0]);
error = get_config(argc, argv);
@@ -877,6 +882,16 @@
orig_loglevel = get_kernel_console_loglevel();
set_kernel_console_loglevel(suspend_loglevel);
+ /*
+ * 30 seconds grace period to allow resume device
+ * to come online (i.e. external USB drive
+ */
+ for (loopcnt = 0; loopcnt < STAT_LOOP_STEPS; loopcnt++) {
+ if (!stat(resume_dev_name, &stat_buf))
+ break;
+ usleep(STAT_TIMEOUT);
+ }
+
while (stat(resume_dev_name, &stat_buf)) {
fprintf(stderr,
"%s: Could not stat the resume device file '%s'\n"
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]