Commit Graph
16 Commits
Author SHA1 Message Date
Daan De Meyer f102bc3e5f tree-wide: Introduce sd-forward.h and shared-forward.h headers
Let's not leak details from src/shared and src/libsystemd into
src/basic, even though you can't actually do anything useful with
just forward declarations from src/shared.

The sd-forward.h header is put in src/libsystemd/sd-common as we
don't have a directory for shared internal headers for libsystemd
yet.

Let's also rename forward.h to basic-forward.h to keep things
self-explanatory.
2025-10-16 17:00:29 +02:00
Lennart Poettering 444af9538f tmpfile-util: introduce new CLEANUP_TMPFILE_AT() API
This should allow us to get rid of a bunch of "fail:" labels, because we
can clean up tmpfiles relative to some atfd this way.

This only ports over a small number of potential users, but there's more
work to be done.
2025-09-17 19:51:13 +01:00
Daan De Meyer 0c15577abe basic + fundamental: Clean up includes
Split out of #37344.
2025-05-25 10:06:07 +02:00
Lennart Poettering c450027d14 env-file: rework write_env_file() to make use of O_TMPFILE 2025-05-22 02:50:48 +09:00
Mike Yuan d845254b7f basic/fs-util: move unlink_tempfilep() to tmpfile-util 2024-10-22 19:19:39 +02:00
Lennart Poettering d19a5facbd tmpfile-util: drop spurious double newline 2023-06-23 18:29:22 +02:00
Lennart Poettering ce67bf366f tmpfile-util: add new LINK_TMPFILE_SYNC flag for syncing properly before/after linking in the file
This syncs the data before linking it in, and both data + dir once done.
This should give us proper semantics for installing files safely into
the fs.
2023-06-13 09:45:39 +02:00
Lennart Poettering 27e18c23bc tmpfile-util: turn last parameter of link_tmpfile() into a proper flags
This changes a boolean param into a proper bitflag field.

Given this only defines a single flag for now this doesn't look like
much of an improvement. But we'll add another flag shortly, where it
starts to make more sense.
2023-06-13 09:40:53 +02:00
Daan De Meyer d294857ea6 tmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at() 2023-03-21 15:20:01 +01:00
Lennart Poettering 23e208e742 tmpfile-util: teach link_tmpfile() to optionally replace files 2023-03-03 13:44:12 +01:00
Daan De Meyer dd3c825294 tmpfile-util: Introduce fopen_temporary_child()
Instead of having fopen_temporary() create the file either next
to an existing file or in tmp/, let's split this up clearly into
two different functions, one for creating temporary files next to
existing files, and one for creating a temporary file in a directory.
2022-11-17 14:14:31 +01:00
Daan De Meyer e624d4cf07 tmpfile-util: Add fopen_temporary_at() 2022-11-09 11:14:10 +01:00
Daan De Meyer 86e69a44b4 tmpfile-util: Introduce mkdtemp_open() 2022-11-09 11:13:58 +01:00
Lennart Poettering a5b30e156a bootctl: generalize open_tmpfile_linkable() use a bit
We want FILE* here, instead of a plain fd. Let's generalize this in
tmpfile-util.c, so we can reuse it later easily.
2022-03-22 00:34:48 +01:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Lennart Poettering e4de72876e util-lib: split out all temporary file related calls into tmpfiles-util.c
This splits out a bunch of functions from fileio.c that have to do with
temporary files. Simply to make the header files a bit shorter, and to
group things more nicely.

No code changes, just some rearranging of source files.
2018-12-02 13:22:29 +01:00