diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-30 21:39:12 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-12-02 13:22:29 +0100 |
commit | 0a2152f005f65e949e81ac05e1b81f878103a15d (patch) | |
tree | df0c2a1a35ca6e47d7163f384dadcdc7138b82a0 /src/basic/fileio.c | |
parent | a12a00c857c550b70039378aa671fdaffe3d1bc9 (diff) | |
download | systemd-0a2152f005f65e949e81ac05e1b81f878103a15d.tar.gz |
util-lib: move open_serialization_fd() to serialize.c
It definitely fits better there.
No code changes, just some rearranging.
Diffstat (limited to 'src/basic/fileio.c')
-rw-r--r-- | src/basic/fileio.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c index 6ccbae02a9..549f987283 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -9,7 +9,6 @@ #include <stdio_ext.h> #include <stdlib.h> #include <string.h> -#include <sys/mman.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -25,7 +24,6 @@ #include "missing.h" #include "parse-util.h" #include "path-util.h" -#include "process-util.h" #include "stdio-util.h" #include "string-util.h" #include "strv.h" @@ -1219,25 +1217,6 @@ int fputs_with_space(FILE *f, const char *s, const char *separator, bool *space) return fputs(s, f); } -int open_serialization_fd(const char *ident) { - int fd; - - fd = memfd_create(ident, MFD_CLOEXEC); - 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); - - return fd; -} - int read_nul_string(FILE *f, char **ret) { _cleanup_free_ char *x = NULL; size_t allocated = 0, n = 0; |