]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: split out IO related calls to io-util.[ch]
authorLennart Poettering <lennart@poettering.net>
Sun, 25 Oct 2015 13:08:25 +0000 (14:08 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2015 00:24:38 +0000 (01:24 +0100)
40 files changed:
Makefile.am
src/basic/copy.c
src/basic/io-util.c [new file with mode: 0644]
src/basic/io-util.h [new file with mode: 0644]
src/basic/random-util.c
src/basic/terminal-util.c
src/basic/util.c
src/basic/util.h
src/bootchart/bootchart.c
src/core/automount.c
src/core/execute.c
src/core/machine-id-setup.c
src/core/manager.c
src/import/import-raw.c
src/import/import-tar.c
src/import/pull-common.c
src/import/pull-job.c
src/journal/compress.c
src/journal/journal-send.c
src/journal/journalctl.c
src/journal/sd-journal.c
src/libsystemd/sd-id128/sd-id128.c
src/libsystemd/sd-login/sd-login.c
src/libsystemd/sd-resolve/sd-resolve.c
src/libudev/libudev-queue.c
src/login/logind-session.c
src/random-seed/random-seed.c
src/resolve/resolved-manager.c
src/rfkill/rfkill.c
src/shared/ask-password-api.c
src/shared/efivars.c
src/shared/logs-show.c
src/shared/spawn-polkit-agent.c
src/systemctl/systemctl.c
src/test/test-util.c
src/tmpfiles/tmpfiles.c
src/tty-ask-password-agent/tty-ask-password-agent.c
src/udev/udevd.c
src/update-done/update-done.c
src/vconsole/vconsole-setup.c

index 5c9bcb4568567f1da41e8dcbc2c8e159e859a3fa..459d54460cad775588ec8e2051a8a2ec2282a9d7 100644 (file)
@@ -781,6 +781,8 @@ libbasic_la_SOURCES = \
        src/basic/refcnt.h \
        src/basic/util.c \
        src/basic/util.h \
+       src/basic/io-util.c \
+       src/basic/io-util.h \
        src/basic/string-util.c \
        src/basic/string-util.h \
        src/basic/fd-util.c \
index c15527df22928039e65e14f9730f8584cda6cd86..9f274c4d51c89360007fe775e169a64063a15959 100644 (file)
@@ -25,6 +25,7 @@
 #include "btrfs-util.h"
 #include "copy.h"
 #include "fd-util.h"
+#include "io-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
diff --git a/src/basic/io-util.c b/src/basic/io-util.c
new file mode 100644 (file)
index 0000000..ac8f93f
--- /dev/null
@@ -0,0 +1,261 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <poll.h>
+#include <unistd.h>
+
+#include "io-util.h"
+
+int flush_fd(int fd) {
+        struct pollfd pollfd = {
+                .fd = fd,
+                .events = POLLIN,
+        };
+
+        for (;;) {
+                char buf[LINE_MAX];
+                ssize_t l;
+                int r;
+
+                r = poll(&pollfd, 1, 0);
+                if (r < 0) {
+                        if (errno == EINTR)
+                                continue;
+
+                        return -errno;
+
+                } else if (r == 0)
+                        return 0;
+
+                l = read(fd, buf, sizeof(buf));
+                if (l < 0) {
+
+                        if (errno == EINTR)
+                                continue;
+
+                        if (errno == EAGAIN)
+                                return 0;
+
+                        return -errno;
+                } else if (l == 0)
+                        return 0;
+        }
+}
+
+ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) {
+        uint8_t *p = buf;
+        ssize_t n = 0;
+
+        assert(fd >= 0);
+        assert(buf);
+
+        /* If called with nbytes == 0, let's call read() at least
+         * once, to validate the operation */
+
+        if (nbytes > (size_t) SSIZE_MAX)
+                return -EINVAL;
+
+        do {
+                ssize_t k;
+
+                k = read(fd, p, nbytes);
+                if (k < 0) {
+                        if (errno == EINTR)
+                                continue;
+
+                        if (errno == EAGAIN && do_poll) {
+
+                                /* We knowingly ignore any return value here,
+                                 * and expect that any error/EOF is reported
+                                 * via read() */
+
+                                (void) fd_wait_for_event(fd, POLLIN, USEC_INFINITY);
+                                continue;
+                        }
+
+                        return n > 0 ? n : -errno;
+                }
+
+                if (k == 0)
+                        return n;
+
+                assert((size_t) k <= nbytes);
+
+                p += k;
+                nbytes -= k;
+                n += k;
+        } while (nbytes > 0);
+
+        return n;
+}
+
+int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll) {
+        ssize_t n;
+
+        n = loop_read(fd, buf, nbytes, do_poll);
+        if (n < 0)
+                return (int) n;
+        if ((size_t) n != nbytes)
+                return -EIO;
+
+        return 0;
+}
+
+int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) {
+        const uint8_t *p = buf;
+
+        assert(fd >= 0);
+        assert(buf);
+
+        if (nbytes > (size_t) SSIZE_MAX)
+                return -EINVAL;
+
+        do {
+                ssize_t k;
+
+                k = write(fd, p, nbytes);
+                if (k < 0) {
+                        if (errno == EINTR)
+                                continue;
+
+                        if (errno == EAGAIN && do_poll) {
+                                /* We knowingly ignore any return value here,
+                                 * and expect that any error/EOF is reported
+                                 * via write() */
+
+                                (void) fd_wait_for_event(fd, POLLOUT, USEC_INFINITY);
+                                continue;
+                        }
+
+                        return -errno;
+                }
+
+                if (_unlikely_(nbytes > 0 && k == 0)) /* Can't really happen */
+                        return -EIO;
+
+                assert((size_t) k <= nbytes);
+
+                p += k;
+                nbytes -= k;
+        } while (nbytes > 0);
+
+        return 0;
+}
+
+int pipe_eof(int fd) {
+        struct pollfd pollfd = {
+                .fd = fd,
+                .events = POLLIN|POLLHUP,
+        };
+
+        int r;
+
+        r = poll(&pollfd, 1, 0);
+        if (r < 0)
+                return -errno;
+
+        if (r == 0)
+                return 0;
+
+        return pollfd.revents & POLLHUP;
+}
+
+int fd_wait_for_event(int fd, int event, usec_t t) {
+
+        struct pollfd pollfd = {
+                .fd = fd,
+                .events = event,
+        };
+
+        struct timespec ts;
+        int r;
+
+        r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL);
+        if (r < 0)
+                return -errno;
+
+        if (r == 0)
+                return 0;
+
+        return pollfd.revents;
+}
+
+static size_t nul_length(const uint8_t *p, size_t sz) {
+        size_t n = 0;
+
+        while (sz > 0) {
+                if (*p != 0)
+                        break;
+
+                n++;
+                p++;
+                sz--;
+        }
+
+        return n;
+}
+
+ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
+        const uint8_t *q, *w, *e;
+        ssize_t l;
+
+        q = w = p;
+        e = q + sz;
+        while (q < e) {
+                size_t n;
+
+                n = nul_length(q, e - q);
+
+                /* If there are more than the specified run length of
+                 * NUL bytes, or if this is the beginning or the end
+                 * of the buffer, then seek instead of write */
+                if ((n > run_length) ||
+                    (n > 0 && q == p) ||
+                    (n > 0 && q + n >= e)) {
+                        if (q > w) {
+                                l = write(fd, w, q - w);
+                                if (l < 0)
+                                        return -errno;
+                                if (l != q -w)
+                                        return -EIO;
+                        }
+
+                        if (lseek(fd, n, SEEK_CUR) == (off_t) -1)
+                                return -errno;
+
+                        q += n;
+                        w = q;
+                } else if (n > 0)
+                        q += n;
+                else
+                        q ++;
+        }
+
+        if (q > w) {
+                l = write(fd, w, q - w);
+                if (l < 0)
+                        return -errno;
+                if (l != q - w)
+                        return -EIO;
+        }
+
+        return q - (const uint8_t*) p;
+}
diff --git a/src/basic/io-util.h b/src/basic/io-util.h
new file mode 100644 (file)
index 0000000..ff7c2a9
--- /dev/null
@@ -0,0 +1,39 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <sys/types.h>
+#include <stdbool.h>
+
+#include "time-util.h"
+
+int flush_fd(int fd);
+
+ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll);
+int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll);
+int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll);
+
+int pipe_eof(int fd);
+
+int fd_wait_for_event(int fd, int event, usec_t timeout);
+
+ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
index e183165b9f878fa540d42c326209ac9fa6172fad..2f5c16e2afbdc7fc3230d7111007960ce8e7b996 100644 (file)
@@ -29,6 +29,7 @@
 #include <time.h>
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "missing.h"
 #include "random-util.h"
 #include "time-util.h"
index 5949b99c95446008dee32b827faec932ed4a3998..3b3ca775d0395f7903d0830d0543702ccc604b27 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "path-util.h"
 #include "process-util.h"
 #include "string-util.h"
index 05f34ea52c67c55bde356f24cad111a59cdbeb58..c02dfc5bc961267d2949d3a3df77c3f820471b81 100644 (file)
@@ -1236,142 +1236,6 @@ bool fstype_is_network(const char *fstype) {
         return nulstr_contains(table, fstype);
 }
 
-int flush_fd(int fd) {
-        struct pollfd pollfd = {
-                .fd = fd,
-                .events = POLLIN,
-        };
-
-        for (;;) {
-                char buf[LINE_MAX];
-                ssize_t l;
-                int r;
-
-                r = poll(&pollfd, 1, 0);
-                if (r < 0) {
-                        if (errno == EINTR)
-                                continue;
-
-                        return -errno;
-
-                } else if (r == 0)
-                        return 0;
-
-                l = read(fd, buf, sizeof(buf));
-                if (l < 0) {
-
-                        if (errno == EINTR)
-                                continue;
-
-                        if (errno == EAGAIN)
-                                return 0;
-
-                        return -errno;
-                } else if (l == 0)
-                        return 0;
-        }
-}
-
-ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll) {
-        uint8_t *p = buf;
-        ssize_t n = 0;
-
-        assert(fd >= 0);
-        assert(buf);
-
-        /* If called with nbytes == 0, let's call read() at least
-         * once, to validate the operation */
-
-        if (nbytes > (size_t) SSIZE_MAX)
-                return -EINVAL;
-
-        do {
-                ssize_t k;
-
-                k = read(fd, p, nbytes);
-                if (k < 0) {
-                        if (errno == EINTR)
-                                continue;
-
-                        if (errno == EAGAIN && do_poll) {
-
-                                /* We knowingly ignore any return value here,
-                                 * and expect that any error/EOF is reported
-                                 * via read() */
-
-                                (void) fd_wait_for_event(fd, POLLIN, USEC_INFINITY);
-                                continue;
-                        }
-
-                        return n > 0 ? n : -errno;
-                }
-
-                if (k == 0)
-                        return n;
-
-                assert((size_t) k <= nbytes);
-
-                p += k;
-                nbytes -= k;
-                n += k;
-        } while (nbytes > 0);
-
-        return n;
-}
-
-int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll) {
-        ssize_t n;
-
-        n = loop_read(fd, buf, nbytes, do_poll);
-        if (n < 0)
-                return (int) n;
-        if ((size_t) n != nbytes)
-                return -EIO;
-
-        return 0;
-}
-
-int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll) {
-        const uint8_t *p = buf;
-
-        assert(fd >= 0);
-        assert(buf);
-
-        if (nbytes > (size_t) SSIZE_MAX)
-                return -EINVAL;
-
-        do {
-                ssize_t k;
-
-                k = write(fd, p, nbytes);
-                if (k < 0) {
-                        if (errno == EINTR)
-                                continue;
-
-                        if (errno == EAGAIN && do_poll) {
-                                /* We knowingly ignore any return value here,
-                                 * and expect that any error/EOF is reported
-                                 * via write() */
-
-                                (void) fd_wait_for_event(fd, POLLOUT, USEC_INFINITY);
-                                continue;
-                        }
-
-                        return -errno;
-                }
-
-                if (_unlikely_(nbytes > 0 && k == 0)) /* Can't really happen */
-                        return -EIO;
-
-                assert((size_t) k <= nbytes);
-
-                p += k;
-                nbytes -= k;
-        } while (nbytes > 0);
-
-        return 0;
-}
-
 int parse_size(const char *t, uint64_t base, uint64_t *size) {
 
         /* Soo, sometimes we want to parse IEC binary suffixes, and
@@ -2057,44 +1921,6 @@ bool plymouth_running(void) {
         return access("/run/plymouth/pid", F_OK) >= 0;
 }
 
-int pipe_eof(int fd) {
-        struct pollfd pollfd = {
-                .fd = fd,
-                .events = POLLIN|POLLHUP,
-        };
-
-        int r;
-
-        r = poll(&pollfd, 1, 0);
-        if (r < 0)
-                return -errno;
-
-        if (r == 0)
-                return 0;
-
-        return pollfd.revents & POLLHUP;
-}
-
-int fd_wait_for_event(int fd, int event, usec_t t) {
-
-        struct pollfd pollfd = {
-                .fd = fd,
-                .events = event,
-        };
-
-        struct timespec ts;
-        int r;
-
-        r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL);
-        if (r < 0)
-                return -errno;
-
-        if (r == 0)
-                return 0;
-
-        return pollfd.revents;
-}
-
 int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
         FILE *f;
         char *t;
@@ -4661,68 +4487,6 @@ int read_attr_path(const char *p, unsigned *ret) {
         return read_attr_fd(fd, ret);
 }
 
-static size_t nul_length(const uint8_t *p, size_t sz) {
-        size_t n = 0;
-
-        while (sz > 0) {
-                if (*p != 0)
-                        break;
-
-                n++;
-                p++;
-                sz--;
-        }
-
-        return n;
-}
-
-ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
-        const uint8_t *q, *w, *e;
-        ssize_t l;
-
-        q = w = p;
-        e = q + sz;
-        while (q < e) {
-                size_t n;
-
-                n = nul_length(q, e - q);
-
-                /* If there are more than the specified run length of
-                 * NUL bytes, or if this is the beginning or the end
-                 * of the buffer, then seek instead of write */
-                if ((n > run_length) ||
-                    (n > 0 && q == p) ||
-                    (n > 0 && q + n >= e)) {
-                        if (q > w) {
-                                l = write(fd, w, q - w);
-                                if (l < 0)
-                                        return -errno;
-                                if (l != q -w)
-                                        return -EIO;
-                        }
-
-                        if (lseek(fd, n, SEEK_CUR) == (off_t) -1)
-                                return -errno;
-
-                        q += n;
-                        w = q;
-                } else if (n > 0)
-                        q += n;
-                else
-                        q ++;
-        }
-
-        if (q > w) {
-                l = write(fd, w, q - w);
-                if (l < 0)
-                        return -errno;
-                if (l != q - w)
-                        return -EIO;
-        }
-
-        return q - (const uint8_t*) p;
-}
-
 void sigkill_wait(pid_t *pid) {
         if (!pid)
                 return;
index e50fd6966437a758ef294efed8bac2dfaecace4e..1a56257cce98b2c34fa90808a0d234d44399c2d6 100644 (file)
@@ -237,14 +237,8 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
 
 bool fstype_is_network(const char *fstype);
 
-int flush_fd(int fd);
-
 int fopen_temporary(const char *path, FILE **_f, char **_temp_path);
 
-ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll);
-int loop_read_exact(int fd, void *buf, size_t nbytes, bool do_poll);
-int loop_write(int fd, const void *buf, size_t nbytes, bool do_poll);
-
 bool is_device_path(const char *path);
 
 int dir_is_empty(const char *path);
@@ -274,8 +268,6 @@ int path_check_fstype(const char *path, statfs_f_type_t magic_value);
 bool is_temporary_fs(const struct statfs *s) _pure_;
 int fd_is_temporary_fs(int fd);
 
-int pipe_eof(int fd);
-
 #define xsprintf(buf, fmt, ...) \
         assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), \
                           "xsprintf: " #buf "[] must be big enough")
@@ -370,8 +362,6 @@ int prot_from_flags(int flags) _const_;
 
 char *format_bytes(char *buf, size_t l, uint64_t t);
 
-int fd_wait_for_event(int fd, int event, usec_t timeout);
-
 void* memdup(const void *p, size_t l) _alloc_(2);
 
 int fd_inc_sndbuf(int fd, size_t n);
@@ -647,8 +637,6 @@ int namespace_enter(int pidns_fd, int mntns_fd, int netns_fd, int userns_fd, int
 int getpeercred(int fd, struct ucred *ucred);
 int getpeersec(int fd, char **ret);
 
-int writev_safe(int fd, const struct iovec *w, int j);
-
 int mkostemp_safe(char *pattern, int flags);
 int open_tmpfile(const char *path, int flags);
 
@@ -721,8 +709,6 @@ int read_attr_path(const char *p, unsigned *ret);
 
 #define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })
 
-ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length);
-
 void sigkill_wait(pid_t *pid);
 #define _cleanup_sigkill_wait_ _cleanup_(sigkill_wait)
 
index a1699f8736b000dc7d3698ec7250c19dfb8f35df..ef113ed40c3e5ac6e34a36859a04b6a64cdf3ed1 100644 (file)
@@ -52,6 +52,7 @@
 #include "conf-parser.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "list.h"
 #include "macro.h"
 #include "path-util.h"
index c25038ca50b72b553860714a68a72e57c9038e38..d362d6579d923fff0482a9f877814869fd6a18e6 100644 (file)
@@ -36,6 +36,7 @@
 #include "dbus-automount.h"
 #include "fd-util.h"
 #include "formats-util.h"
+#include "io-util.h"
 #include "label.h"
 #include "mkdir.h"
 #include "mount.h"
index 83ae3f6253e969a02b6db0c51e8d5558a3ec6de1..55da8ba4b72122f837315ab36fd81cc9500143b8 100644 (file)
@@ -69,6 +69,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "formats-util.h"
+#include "io-util.h"
 #include "ioprio.h"
 #include "log.h"
 #include "macro.h"
index f59bf56c73cceda8a61d0cc7057f0f408593c5fb..c72892b3438e3d355ff3558d0a4f15a1e5018f98 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "log.h"
 #include "machine-id-setup.h"
 #include "macro.h"
index 400c66977b4c400f74bceb248d6fd1156c265d1e..287676ff27023870963030fca278c5584135729c 100644 (file)
@@ -55,6 +55,7 @@
 #include "exit-status.h"
 #include "fd-util.h"
 #include "hashmap.h"
+#include "io-util.h"
 #include "locale-setup.h"
 #include "log.h"
 #include "macro.h"
index f8fc6c108a7b0292f8e21d1c7d9a52375e8b2193..a34f30abfcf7d6244f6dd2957d34c7fec4a20abc 100644 (file)
@@ -31,6 +31,7 @@
 #include "import-common.h"
 #include "import-compress.h"
 #include "import-raw.h"
+#include "io-util.h"
 #include "machine-pool.h"
 #include "mkdir.h"
 #include "path-util.h"
index bc0cd9f5ba8b19953d16d891a94854d252b4ffe6..9aade0f4304ba192f95c1e83fc05bbd9855529d7 100644 (file)
@@ -31,6 +31,7 @@
 #include "import-common.h"
 #include "import-compress.h"
 #include "import-tar.h"
+#include "io-util.h"
 #include "machine-pool.h"
 #include "mkdir.h"
 #include "path-util.h"
index e98554b60c1e2e2b4b973b38844896dc55473adc..f465154b1d400f1d6c39d99011cfefd4a285f81c 100644 (file)
@@ -26,6 +26,7 @@
 #include "copy.h"
 #include "escape.h"
 #include "fd-util.h"
+#include "io-util.h"
 #include "process-util.h"
 #include "pull-common.h"
 #include "pull-job.h"
index 7a0fb54bbe519bde9bfcdcbc4769c64572c86a5e..4736306de22c0ecf425096a8635f7b8f44a8be50 100644 (file)
@@ -22,6 +22,7 @@
 #include <sys/xattr.h>
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "machine-pool.h"
 #include "pull-job.h"
 #include "string-util.h"
index 92f584777cf21544143ce6c590805a5c524a813f..9308e8b789b4f2a53119423fbcb9fb343b778a05 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "compress.h"
 #include "fd-util.h"
+#include "io-util.h"
 #include "journal-def.h"
 #include "macro.h"
 #include "sparse-endian.h"
index d42f8262a57881db04a2f72c7c040949bdd60ebd..f388c30d2e4e4aa757adbe62df5cb1d6f703208e 100644 (file)
@@ -32,6 +32,7 @@
 #include "sd-journal.h"
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "memfd-util.h"
 #include "socket-util.h"
 #include "string-util.h"
index dbb05e0527e3d4113877ef5448fee0f07aae4cc3..dee25841e1845e315649cef9a00ee4d34034f65c 100644 (file)
@@ -46,6 +46,7 @@
 #include "fileio.h"
 #include "fsprg.h"
 #include "hostname-util.h"
+#include "io-util.h"
 #include "journal-def.h"
 #include "journal-internal.h"
 #include "journal-qrcode.h"
index d39c0a900c8b15cd01b5af84dbae9884c2f7ef08..9dcfc726eaeb0cdf5f09275a9111b42ed16362a2 100644 (file)
@@ -29,6 +29,7 @@
 #include <unistd.h>
 
 #include "sd-journal.h"
+
 #include "catalog.h"
 #include "compress.h"
 #include "fd-util.h"
@@ -36,6 +37,7 @@
 #include "formats-util.h"
 #include "hashmap.h"
 #include "hostname-util.h"
+#include "io-util.h"
 #include "journal-def.h"
 #include "journal-file.h"
 #include "journal-internal.h"
index ef89fd2572fcdbc3b218d09fdc824b0b9c12cc23..335ad3b1b4406b2049f9e05462a9176f568869a5 100644 (file)
 
 #include "sd-id128.h"
 
+#include "fd-util.h"
+#include "io-util.h"
 #include "macro.h"
 #include "random-util.h"
 #include "util.h"
-#include "fd-util.h"
 
 _public_ char *sd_id128_to_string(sd_id128_t id, char s[SD_ID128_STRING_MAX]) {
         unsigned n;
index 399918f834149640cf96a523e18055514c298cf2..e1f480d0588ec872399eee59f2d30e1dae35f718 100644 (file)
@@ -33,6 +33,7 @@
 #include "fileio.h"
 #include "formats-util.h"
 #include "hostname-util.h"
+#include "io-util.h"
 #include "login-util.h"
 #include "macro.h"
 #include "string-util.h"
index 38e2dc0fdd23052b6e9cfb3bad63c3714d76c37b..724405d534febac25f0fed284327e71977f78ee4 100644 (file)
@@ -34,6 +34,7 @@
 #include "sd-resolve.h"
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "list.h"
 #include "missing.h"
 #include "resolve-util.h"
index 4d1a0adbf21a8150fb1ed672dadb08f617c6e55a..a22994c8a249835829775e38b9b99226cd77657c 100644 (file)
@@ -25,6 +25,7 @@
 #include <sys/inotify.h>
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "libudev-private.h"
 
 /**
index ead79ad327d929b698eb35b0f50a621615f94aad..10f1cfef810ec27ecc0dbbffc01e9e7891aeb23d 100644 (file)
 #include "bus-util.h"
 #include "escape.h"
 #include "fd-util.h"
+#include "fd-util.h"
 #include "fileio.h"
 #include "formats-util.h"
+#include "io-util.h"
 #include "logind-session.h"
 #include "mkdir.h"
 #include "path-util.h"
index 42841480c506acc23e45e019fc37bd3338ee5303..fbfd3a3eba78a4e5594f687685d3615ce087b77f 100644 (file)
@@ -26,6 +26,7 @@
 #include <unistd.h>
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "log.h"
 #include "mkdir.h"
 #include "string-util.h"
index 65476fa38bfd8a9346fd38aa5f1bf200c184f546..6144eedfeb87242e2ed979290ca42a9419f0beb2 100644 (file)
@@ -29,6 +29,7 @@
 #include "fd-util.h"
 #include "fileio-label.h"
 #include "hostname-util.h"
+#include "io-util.h"
 #include "netlink-util.h"
 #include "network-internal.h"
 #include "ordered-set.h"
index df8fc0690d8ec17e44d258e7101eb96003537f25..311343e4547eec44aa4ec0b8291d288e48a92118 100644 (file)
@@ -28,6 +28,7 @@
 #include "escape.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "mkdir.h"
 #include "string-util.h"
 #include "udev-util.h"
index baa6f159f834f50602a91fc45fb41f9d1a37de53..15203d21eae307929c65cd21ab49dcd277f1c12b 100644 (file)
@@ -35,6 +35,7 @@
 #include "ask-password-api.h"
 #include "fd-util.h"
 #include "formats-util.h"
+#include "io-util.h"
 #include "missing.h"
 #include "mkdir.h"
 #include "random-util.h"
index b482603bce987b987651a99f758e7e1be934c392..4808ede60c701734fea4832372d506fe50a25f95 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "efivars.h"
 #include "fd-util.h"
+#include "io-util.h"
 #include "utf8.h"
 #include "util.h"
 #include "virt.h"
index 6f5b83d08d4e2c2019627fc8caa8c9d30fa99516..d8ea4c9f9269a94b71e5560138df818c23183c8b 100644 (file)
@@ -29,6 +29,7 @@
 #include "formats-util.h"
 #include "hashmap.h"
 #include "hostname-util.h"
+#include "io-util.h"
 #include "journal-internal.h"
 #include "log.h"
 #include "logs-show.h"
index 472cdecf2054b674204726f6926d862d0cf820b1..7cc9e7ccc19d2b22097476a31af7a6835f6e91f7 100644 (file)
 #include <errno.h>
 #include <poll.h>
 
+#include "fd-util.h"
+#include "io-util.h"
 #include "log.h"
-#include "util.h"
 #include "process-util.h"
 #include "spawn-polkit-agent.h"
-#include "fd-util.h"
+#include "util.h"
 
 #ifdef ENABLE_POLKIT
 static pid_t agent_pid = 0;
index 213c3c30a0870b17324c8939c30cc2a7626ca49a..49acea1dd22114ec93e778a1d7d0fc155c8cfc0a 100644 (file)
@@ -54,6 +54,7 @@
 #include "hostname-util.h"
 #include "initreq.h"
 #include "install.h"
+#include "io-util.h"
 #include "list.h"
 #include "log.h"
 #include "logs-show.h"
index ddfcdd857b8b4e1f3039dd7f8e9097fa873665b3..86895733c08381566647e6f67dafaebf1dc1f5da 100644 (file)
@@ -35,7 +35,9 @@
 #include "cpu-set-util.h"
 #include "def.h"
 #include "escape.h"
+#include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "mkdir.h"
 #include "process-util.h"
 #include "rm-rf.h"
@@ -44,7 +46,6 @@
 #include "strv.h"
 #include "util.h"
 #include "virt.h"
-#include "fd-util.h"
 
 static void test_streq_ptr(void) {
         assert_se(streq_ptr(NULL, NULL));
index e574e5ac26d013780845a85e6b1a331f8ff4fdbe..457d721303629496f66b15e0c5f1e3888160d985 100644 (file)
@@ -46,6 +46,7 @@
 #include "escape.h"
 #include "fd-util.h"
 #include "formats-util.h"
+#include "io-util.h"
 #include "label.h"
 #include "log.h"
 #include "macro.h"
index 30f7f42a099d4c4aec1906e0a3d8ef823fc31ab9..33419f696263c08d70828274ad56c21e1b99a8d6 100644 (file)
@@ -36,6 +36,7 @@
 #include "conf-parser.h"
 #include "def.h"
 #include "fd-util.h"
+#include "io-util.h"
 #include "mkdir.h"
 #include "path-util.h"
 #include "process-util.h"
index a548f9ba4905be80f3ba1fb510a1e48df4653868..df5fd88bff5808e1658e21ad2d3eb98932e87583 100644 (file)
@@ -51,6 +51,7 @@
 #include "fileio.h"
 #include "formats-util.h"
 #include "hashmap.h"
+#include "io-util.h"
 #include "netlink-util.h"
 #include "process-util.h"
 #include "selinux-util.h"
index 4f67145b365913ca458f4ce31e2fdcca24981f7d..4c44d5061370a0e7000e8e3e29e0d1a456f8e26f 100644 (file)
@@ -20,6 +20,7 @@
 ***/
 
 #include "fd-util.h"
+#include "io-util.h"
 #include "selinux-util.h"
 #include "util.h"
 
index a06f61dd6fd62a5bbc0040ef0365d9f48f213e88..49523a0a677bde5091e4fe054dd243b79b0040b3 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "fd-util.h"
 #include "fileio.h"
+#include "io-util.h"
 #include "log.h"
 #include "process-util.h"
 #include "signal-util.h"