}
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;
}