diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-01-23 13:15:27 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-01-24 15:32:43 +0100 |
commit | a9bd4b4ed97c7a6b909febe89a9d2be2c78f3f74 (patch) | |
tree | 98664c36fd8af813f4c1c26ecd502d7ae0af9027 /src/basic/os-util.c | |
parent | 469af08f58049a2a67b9e0289873a7f3300f5609 (diff) | |
download | systemd-a9bd4b4ed97c7a6b909febe89a9d2be2c78f3f74.tar.gz |
os-util: accept SUPPORT_END= with empty string as explicit way to disable concept
Diffstat (limited to 'src/basic/os-util.c')
-rw-r--r-- | src/basic/os-util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/os-util.c b/src/basic/os-util.c index 3a2e4f59a6..3b50279a44 100644 --- a/src/basic/os-util.c +++ b/src/basic/os-util.c @@ -349,14 +349,14 @@ int os_release_support_ended(const char *support_end, bool quiet) { if (r < 0 && r != -ENOENT) return log_full_errno(quiet ? LOG_DEBUG : LOG_WARNING, r, "Failed to read os-release file, ignoring: %m"); - if (!_support_end_alloc) - return false; /* no end date defined */ support_end = _support_end_alloc; } - struct tm tm = {}; + if (isempty(support_end)) /* An empty string is a explicit way to say "no EOL exists" */ + return false; /* no end date defined */ + struct tm tm = {}; const char *k = strptime(support_end, "%Y-%m-%d", &tm); if (!k || *k) return log_full_errno(quiet ? LOG_DEBUG : LOG_WARNING, SYNTHETIC_ERRNO(EINVAL), |