]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/coredump/coredump.c
coredump,basic: generalize O_TMPFILE handling a bit
authorLennart Poettering <lennart@poettering.net>
Wed, 20 Apr 2016 17:27:32 +0000 (19:27 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Apr 2016 14:16:53 +0000 (16:16 +0200)
commit03532f0ae0fae40f9f04091340e2bf156d0ec21a
tree52c0ad443ed1cbec01971d9284ca47ac276f00e9
parentf8591ee1b6c152055feed7a872159e67859fd83d
coredump,basic: generalize O_TMPFILE handling a bit

This moves the O_TMPFILE handling from the coredumping code into common library
code, and generalizes it as open_tmpfile_linkable() + link_tmpfile(). The
existing open_tmpfile() function (which creates an unlinked temporary file that
cannot be linked into the fs) is renamed to open_tmpfile_unlinkable(), to make
the distinction clear. Thus, code may now choose between:

 a) open_tmpfile_linkable() + link_tmpfile()
 b) open_tmpfile_unlinkable()

Depending on whether they want a file that may be linked back into the fs later
on or not.

In a later commit we should probably convert fopen_temporary() to make use of
open_tmpfile_linkable().

Followup for: #3065
src/basic/fileio.c
src/basic/fileio.h
src/core/manager.c
src/coredump/coredump.c
src/journal-remote/journal-gatewayd.c
src/journal/journal-send.c
src/journal/journal-verify.c
src/test/test-tmpfiles.c