mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
tre-wide: use FORMAT_DEVNUM() a bit more
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "bus-locator.h"
|
||||
#include "bus-util.h"
|
||||
#include "constants.h"
|
||||
#include "devnum-util.h"
|
||||
#include "exec-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
@@ -45,13 +46,14 @@ static SleepOperation arg_operation = _SLEEP_OPERATION_INVALID;
|
||||
|
||||
static int write_hibernate_location_info(const HibernateLocation *hibernate_location) {
|
||||
char offset_str[DECIMAL_STR_MAX(uint64_t)];
|
||||
char resume_str[DECIMAL_STR_MAX(unsigned) * 2 + STRLEN(":")];
|
||||
const char *resume_str;
|
||||
int r;
|
||||
|
||||
assert(hibernate_location);
|
||||
assert(hibernate_location->swap);
|
||||
|
||||
xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno));
|
||||
resume_str = FORMAT_DEVNUM(hibernate_location->devno);
|
||||
|
||||
r = write_string_file("/sys/power/resume", resume_str, WRITE_STRING_FILE_DISABLE_BUFFER);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m",
|
||||
|
||||
@@ -439,7 +439,7 @@ static int merge_hierarchy(
|
||||
if (!f)
|
||||
return log_oom();
|
||||
|
||||
r = write_string_filef(f, WRITE_STRING_FILE_CREATE, "%u:%u", major(st.st_dev), minor(st.st_dev));
|
||||
r = write_string_file(f, FORMAT_DEVNUM(st.st_dev), WRITE_STRING_FILE_CREATE);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to write '%s': %m", f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user