diff options
Diffstat (limited to 'mem-suspend.c')
-rw-r--r-- | mem-suspend.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/mem-suspend.c b/mem-suspend.c index baeb7e64e5c4..a343db4df375 100644 --- a/mem-suspend.c +++ b/mem-suspend.c @@ -3,20 +3,19 @@ #include <fcntl.h> #include <errno.h> -static const char *state_path = "/sys/power/state"; - -int main(void) +int +main(void) { - int fd = open(state_path, O_WRONLY | O_TRUNC); - if (fd != -1) - { - write(fd, "mem", 3); - close(fd); - } - else - { - perror(state_path); - return errno; - } - return 0; + static const char *path = "/sys/power/state"; + int fd = open(path, O_WRONLY | O_TRUNC); + + if (fd != -1) { + write(fd, "mem", 3); + close(fd); + } else { + perror(path); + return errno; + } + + return 0; } |