From 52cd287933b0f116913ddcc9065fdbf4a81f20c8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 13 Dec 2024 18:59:15 +0100 Subject: [PATCH] serialize: drop memfd fallback when serializing --- src/shared/serialize.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/shared/serialize.c b/src/shared/serialize.c index 735caf4978f..eb490aa2c4a 100644 --- a/src/shared/serialize.c +++ b/src/shared/serialize.c @@ -547,21 +547,12 @@ void deserialize_ratelimit(RateLimit *rl, const char *name, const char *value) { } int open_serialization_fd(const char *ident) { - int fd; - fd = memfd_create_wrapper(ident, MFD_CLOEXEC | MFD_NOEXEC_SEAL); - if (fd < 0) { - const char *path; - - path = getpid_cached() == 1 ? "/run/systemd" : "/tmp"; - fd = open_tmpfile_unlinkable(path, O_RDWR|O_CLOEXEC); - if (fd < 0) - return fd; - - log_debug("Serializing %s to %s.", ident, path); - } else - log_debug("Serializing %s to memfd.", ident); + int fd = memfd_create_wrapper(ident, MFD_CLOEXEC | MFD_NOEXEC_SEAL); + if (fd < 0) + return fd; + log_debug("Serializing %s to memfd.", ident); return fd; }