← Commit list

14ed4ec8a

Denys Vlasenko
Denys Vlasenko
2021-03-20
SUCCESS Duration: 150s

Subject

resume: write offset in /sys/power/resume_offset

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

klibc-utils/resume.c+8 -1
@@ -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 */