]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
serialize: drop memfd fallback when serializing
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Dec 2024 17:59:15 +0000 (18:59 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Dec 2024 17:26:15 +0000 (18:26 +0100)
src/shared/serialize.c

index 735caf4978f1afeef77ac8ee3bb660d1d124361f..eb490aa2c4a1e09eaf5400d3346e186dea8912bb 100644 (file)
@@ -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;
 }