Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 563762 Details for
Bug 677062
sys-auth/elogind-239.3 (with LVM) breaks hibernation - elogind-daemon: Failed to write hibernation disk offset: Invalid argument
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix typo
as (text/plain), 1.59 KB, created by
wranz
on 2019-02-04 21:51:26 UTC
(
hide
)
Description:
fix typo
Filename:
MIME Type:
Creator:
wranz
Created:
2019-02-04 21:51:26 UTC
Size:
1.59 KB
patch
obsolete
>diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c >index ca3befb30..6a3daab30 100644 >--- a/src/sleep/sleep.c >+++ b/src/sleep/sleep.c >@@ -35,6 +35,7 @@ static int write_hibernate_location_info(void) { > _cleanup_free_ struct fiemap *fiemap = NULL; > char offset_str[DECIMAL_STR_MAX(uint64_t)]; > char device_str[DECIMAL_STR_MAX(uint64_t)]; >+ char device_num_str [DECIMAL_STR_MAX(uint)*2+1]; > _cleanup_close_ int fd = -1; > struct stat stb; > uint64_t offset; >@@ -44,10 +45,15 @@ static int write_hibernate_location_info(void) { > if (r < 0) > return log_debug_errno(r, "Unable to find hibernation location: %m"); > >- /* if it's a swap partition, we just write the disk to /sys/power/resume */ >- if (streq(type, "partition")) >- return write_string_file("/sys/power/resume", device, 0); >- else if (!streq(type, "file")) >+ /* if it's a swap partition, we just write the corresponding major:minor numbers to /sys/power/resume */ >+ if (streq(type, "partition")) { >+ r = stat( device, &stb); >+ if (r == -1) { >+ return log_debug_errno(errno, "Error while trying to get stats for %s: %m", device); >+ } >+ sprintf(device_num_str, "%u:%u",major(stb.st_rdev) , minor(stb.st_rdev) ); >+ return write_string_file("/sys/power/resume", device_num_str, 0); >+ }else if (!streq(type, "file")) > return log_debug_errno(EINVAL, "Invalid hibernate type %s: %m", > type); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 677062
:
563544
|
563760
|
563762
|
564618