systemd: merge branch systemd into master

This commit is contained in:
Thomas Haller 2017-10-27 10:41:45 +02:00
commit e1dbe35acd
2 changed files with 5 additions and 12 deletions

View file

@ -148,10 +148,6 @@ clockid_t clock_boottime_or_monotonic(void);
usec_t usec_shift_clock(usec_t, clockid_t from, clockid_t to);
#define xstrftime(buf, fmt, tm) \
assert_message_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0, \
"xstrftime: " #buf "[] must be big enough")
int get_timezone(char **timezone);
time_t mktime_or_timegm(struct tm *tm, bool utc);

View file

@ -182,15 +182,12 @@ int block_get_whole_disk(dev_t d, dev_t *ret) {
}
bool kexec_loaded(void) {
bool loaded = false;
char *s;
_cleanup_free_ char *s = NULL;
if (read_one_line_file("/sys/kernel/kexec_loaded", &s) >= 0) {
if (s[0] == '1')
loaded = true;
free(s);
}
return loaded;
if (read_one_line_file("/sys/kernel/kexec_loaded", &s) < 0)
return false;
return s[0] == '1';
}
int prot_from_flags(int flags) {