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.
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
|
||||
#include "acl-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "string-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
|
||||
static void test_add_acls_for_user(void) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "async.h"
|
||||
#include "fileio.h"
|
||||
#include "macro.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static bool test_async = false;
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "chown-recursive.h"
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
#include "rm-rf.h"
|
||||
#include "string-util.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
static const uint8_t acl[] = {
|
||||
0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00,
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
static void test_clock_is_localtime(void) {
|
||||
_cleanup_(unlink_tempfilep) char adjtime[] = "/tmp/test-adjtime.XXXXXX";
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_config_parse_path_one(const char *rvalue, const char *expected) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "capability-util.h"
|
||||
#include "dev-setup.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "path-util.h"
|
||||
#include "rm-rf.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
_cleanup_(rm_rf_physical_and_freep) char *p = NULL;
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
#include "process-util.h"
|
||||
#include "random-util.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_close_many(void) {
|
||||
int fds[3];
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include "fd-util.h"
|
||||
#include "fdset.h"
|
||||
#include "fileio.h"
|
||||
#include "macro.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_fdset_new_fill(void) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_parse_env_file(void) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "id128-util.h"
|
||||
#include "macro.h"
|
||||
@@ -16,6 +15,7 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "glob-util.h"
|
||||
#include "macro.h"
|
||||
#include "rm-rf.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
static void test_glob_exists(void) {
|
||||
char name[] = "/tmp/test-glob_exists.XXXXXX";
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "fileio.h"
|
||||
#include "hostname-util.h"
|
||||
#include "string-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_hostname_is_valid(void) {
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "id128-util.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#define ID128_WALDI SD_ID128_MAKE(01, 02, 03, 04, 05, 06, 07, 08, 09, 0a, 0b, 0c, 0d, 0e, 0f, 10)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "serialize.h"
|
||||
#include "strv.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
char long_string[LONG_LINE_MAX+1];
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "escape.h"
|
||||
#include "exit-status.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "io-util.h"
|
||||
#include "log.h"
|
||||
@@ -17,8 +16,9 @@
|
||||
#include "process-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_ifname_valid(void) {
|
||||
log_info("/* %s */", __func__);
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "macro.h"
|
||||
#include "missing.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "path-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
|
||||
static void test_files_same(void) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "tests.h"
|
||||
#include "macro.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static void test_default_term_for_tty(void) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "process-util.h"
|
||||
#include "string-util.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <sys/capability.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "all-units.h"
|
||||
#include "alloc-util.h"
|
||||
#include "capability-util.h"
|
||||
#include "conf-parser.h"
|
||||
#include "fd-util.h"
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "strv.h"
|
||||
#include "test-helper.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "tests.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "xattr-util.h"
|
||||
|
||||
static void test_fgetxattrat_fake(void) {
|
||||
|
||||
Reference in New Issue
Block a user