1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-08 08:58:27 +03:00

Merge pull request #12109 from poettering/sleep-minifixes

tiny fixes to sleep.c
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-03-26 19:26:11 +01:00 committed by GitHub
commit a1917c55c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

7
TODO
View File

@ -23,6 +23,13 @@ Janitorial Clean-ups:
Features:
* clean up sleep.c:
- Use CLOCK_BOOTTIME_ALARM for waking up s2h instead of RTC ioctls
- Parse sleep.conf only once, and parse its whole contents so that we don't
have to parse it again and again in s2h
- Make sure resume= and resume_offset= on the kernel cmdline always take
precedence
* maybe add a seccomp-based high-level filter that blocks creation of suid/sgid
files.

View File

@ -17,6 +17,7 @@
#include "conf-parser.h"
#include "def.h"
#include "env-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
@ -201,8 +202,7 @@ int find_hibernate_location(char **device, char **type, size_t *size, size_t *us
if (!f) {
log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
"Failed to retrieve open /proc/swaps: %m");
assert(errno > 0);
return -errno;
return negative_errno();
}
(void) fscanf(f, "%*s %*s %*s %*s %*s\n");

View File

@ -166,7 +166,7 @@ static int execute(char **modes, char **states) {
return log_error_errno(r, "Failed to write mode to /sys/power/disk: %m");;
}
execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments, NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
(void) execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments, NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
log_struct(LOG_INFO,
"MESSAGE_ID=" SD_MESSAGE_SLEEP_START_STR,
@ -186,7 +186,7 @@ static int execute(char **modes, char **states) {
"SLEEP=%s", arg_verb);
arguments[1] = (char*) "post";
execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments, NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
(void) execute_directories(dirs, DEFAULT_TIMEOUT_USEC, NULL, NULL, arguments, NULL, EXEC_DIR_PARALLEL | EXEC_DIR_IGNORE_ERRORS);
return r;
}