diff options
Diffstat (limited to 'klibc-utils/resume.c')
-rw-r--r-- | klibc-utils/resume.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/klibc-utils/resume.c b/klibc-utils/resume.c index 2bf50f9b8..8c4ab26c4 100644 --- a/klibc-utils/resume.c +++ b/klibc-utils/resume.c @@ -103,10 +103,17 @@ int resume_main(int argc UNUSED_PARAM, char **argv) if (major(resume_device) == 0) { bb_error_msg_and_die("invalid resume device: %s", argv[0]); } + ofs = (argv[1] ? xstrtoull(argv[1], 0) : 0); + /* Old kernels have no /sys/power/resume_offset, set it only if necessary */ + if (ofs != 0) { + fd = xopen("/sys/power/resume_offset", O_WRONLY); + s = xasprintf("%llu", ofs); + xwrite_str(fd, s); + } fd = xopen("/sys/power/resume", O_WRONLY); - s = xasprintf("%u:%u:%llu", major(resume_device), minor(resume_device), ofs); + s = xasprintf("%u:%u", major(resume_device), minor(resume_device)); xwrite_str(fd, s); /* if write() returns, resume did not succeed */ |