#include "util.h"
#include "systemd/sd-id128.h"
#include "systemd/sd-messages.h"
+#include "fileio.h"
int main(int argc, char *argv[]) {
const char *verb;
/* Configure the hibernation mode */
if (streq(argv[1], "hibernate")) {
- if (write_one_line_file("/sys/power/disk", "platform") < 0)
- write_one_line_file("/sys/power/disk", "shutdown");
+ if (write_string_file("/sys/power/disk", "platform") < 0)
+ write_string_file("/sys/power/disk", "shutdown");
} else if (streq(argv[1], "hybrid-sleep")) {
- if (write_one_line_file("/sys/power/disk", "suspend") < 0)
- if (write_one_line_file("/sys/power/disk", "platform") < 0)
- write_one_line_file("/sys/power/disk", "shutdown");
+ if (write_string_file("/sys/power/disk", "suspend") < 0)
+ if (write_string_file("/sys/power/disk", "platform") < 0)
+ write_string_file("/sys/power/disk", "shutdown");
}
f = fopen("/sys/power/state", "we");