#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"
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",
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);