]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
macro: Reduce transitive includes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 5 May 2025 14:03:20 +0000 (16:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 9 May 2025 09:33:31 +0000 (11:33 +0200)
76 files changed:
src/basic/alloc-util.h
src/basic/architecture.h
src/basic/arphrd-util.c
src/basic/assert-util.c
src/basic/capsule-util.c
src/basic/cgroup-util.h
src/basic/confidential-virt.h
src/basic/devnum-util.c
src/basic/devnum-util.h
src/basic/dirent-util.h
src/basic/env-util.h
src/basic/errno-list.c
src/basic/errno-util.h
src/basic/fd-util.h
src/basic/hash-funcs.c
src/basic/hexdecoct.c
src/basic/ioprio-util.c
src/basic/iovec-wrapper.c
src/basic/label.c
src/basic/locale-util.h
src/basic/log.h
src/basic/macro.h
src/basic/memory-util.h
src/basic/nulstr-util.h
src/basic/percent-util.h
src/basic/pidref.h
src/basic/ratelimit.c
src/basic/sha256.c
src/basic/sort-util.h
src/basic/static-destruct.h
src/basic/string-table.c
src/basic/string-util.h
src/basic/syslog-util.c
src/basic/time-util.h
src/boot/boot.c
src/boot/efi-string.c
src/boot/pe.c
src/boot/stub.c
src/core/kill.h
src/core/unit-dependency-atom.c
src/fundamental/macro-fundamental.h
src/import/import-compress.h
src/import/qcow2-util.c
src/libsystemd/sd-bus/bus-signature.c
src/libsystemd/sd-journal/journal-def.h
src/libsystemd/sd-json/json-util.c
src/libudev/libudev-device.c
src/libudev/libudev-enumerate.c
src/libudev/libudev-hwdb.c
src/libudev/libudev-queue.c
src/libudev/libudev.c
src/network/netdev/netdev-util.h
src/network/tc/tc-util.c
src/resolve/dns-type.h
src/shared/apparmor-util.h
src/shared/blkid-util.c
src/shared/bond-util.h
src/shared/bus-locator.c
src/shared/color-util.c
src/shared/condition.h
src/shared/copy.c
src/shared/coredump-util.h
src/shared/dev-setup.c
src/shared/idn-util.h
src/shared/import-util.h
src/shared/ipvlan-util.h
src/shared/libarchive-util.h
src/shared/libfido2-util.h
src/shared/open-file.h
src/shared/recovery-key.c
src/shared/selinux-util.h
src/shared/smbios11.c
src/test/test-dirent-util.c
src/test/test-fs-util.c
src/test/test-json.c
src/test/test-sizeof.c

index f82530bdc2419aea768e6220def8c73ea3fdd034..900e798b573c606f377ca5a9b140fbd48c9c252d 100644 (file)
@@ -137,6 +137,29 @@ static inline void *memdup_suffix0_multiply(const void *p, size_t need, size_t s
         return memdup_suffix0(p, size * need);
 }
 
+static inline size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
+        size_t m;
+
+        /* Round up allocation sizes a bit to some reasonable, likely larger value. This is supposed to be
+         * used for cases which are likely called in an allocation loop of some form, i.e. that repetitively
+         * grow stuff, for example strv_extend() and suchlike.
+         *
+         * Note the difference to GREEDY_REALLOC() here, as this helper operates on a single size value only,
+         * and rounds up to next multiple of 2, needing no further counter.
+         *
+         * Note the benefits of direct ALIGN_POWER2() usage: type-safety for size_t, sane handling for very
+         * small (i.e. <= 2) and safe handling for very large (i.e. > SSIZE_MAX) values. */
+
+        if (l <= 2)
+                return 2; /* Never allocate less than 2 of something.  */
+
+        m = ALIGN_POWER2(l);
+        if (m == 0) /* overflow? */
+                return l;
+
+        return m;
+}
+
 void* greedy_realloc(void **p, size_t need, size_t size);
 void* greedy_realloc0(void **p, size_t need, size_t size);
 void* greedy_realloc_append(void **p, size_t *n_p, const void *from, size_t n_from, size_t size);
index 26aa9f405e3a527fbfdb45ca785194cc7b239ce0..4d06e5c3a48289fc631dcb22bee9ca1b7add67fb 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <endian.h>
+#include <errno.h>
 
 #include "macro.h"
 
index 540d7d984e32f33361c1aab53bac1ed8823d45d5..2aa48182fcce6f11aa72d7c4e133175ba71b3008 100644 (file)
@@ -7,6 +7,7 @@
 #include <string.h>
 
 #include "arphrd-util.h"
+#include "assert-util.h"
 #include "macro.h"
 
 static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);
index f4cf97ad28bc769fa4a3bbf2e228b7f4ceb2acb7..add9e92c5228fc3ea07f0a6539698e0eae8f05a8 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
 #include <stdio.h>
 
 #include "assert-util.h"
index d2d6b19448533e107c069a9ba44c9d9e0f656efa..83fcf7afbcc30c710442632da894cbf00376adc2 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <errno.h>
+
 #include "alloc-util.h"
 #include "capsule-util.h"
 #include "path-util.h"
index 949de7f9e24888d55097e59d1c542a773b9a919b..8434a094a0ee26cc11355b804a84d8c9e7816e44 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <dirent.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
 #include <stdint.h>
index 097bbf7cfe28fa574c7c6c16e119064e94682dc3..bbab12310238c292ad4b476678a395ef2832787d 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 
 #include "errno-list.h"
index ab4da865f28d380bbd6dbde1c5296b15ca85e58d..7be34ca0ef72638ef1eb8afa7e84ee6ad631d290 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <string.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 
 #include "alloc-util.h"
 #include "chase.h"
index 0efca567809a5f632b219d066a52682d316acf14..0e07df5e8cb2ff659500d7ad947518444c58f316 100644 (file)
@@ -4,6 +4,7 @@
 #include <inttypes.h>
 #include <stdbool.h>
 #include <sys/types.h>
+#include <sys/sysmacros.h>
 
 #include "stdio-util.h"
 
index f3007b6bc306244dbac3aa455a0671f960daa482..4c8d96788b16243c768112abf8191e425626dca8 100644 (file)
@@ -5,6 +5,7 @@
 #include <errno.h>
 #include <stdbool.h>
 
+#include "assert-util.h"
 #include "macro.h"
 #include "path-util.h"
 
index 52771ecc810cf6c58f74f173792273e34b3ddef6..14f2e718232e805f50794c4b45bf8b17f7522a69 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#include "assert-util.h"
 #include "macro.h"
 #include "string.h"
 
index 897f63030749774ea109908498288c6bf9365222..677b906cc549e59bd288c9f984eb28783e66a8b2 100644 (file)
@@ -3,6 +3,7 @@
 #include <errno.h>
 #include <string.h>
 
+#include "assert-util.h"
 #include "errno-list.h"
 #include "macro.h"
 
index e7dcad3b44832ef21813eff99633acdbc1834a8a..2a5a5abb8a6a3b7f9cb884762771139c98a4a59a 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <inttypes.h>
 #include <string.h>
 
@@ -42,6 +43,12 @@ static inline void _reset_errno_(int *saved_errno) {
         PROTECT_ERRNO;                          \
         errno = ABS(value)
 
+#define return_with_errno(r, err)                     \
+        do {                                          \
+                errno = ABS(err);                     \
+                return r;                             \
+        } while (false)
+
 static inline int negative_errno(void) {
         /* This helper should be used to shut up gcc if you know 'errno' is
          * negative. Instead of "return -errno;", use "return negative_errno();"
@@ -103,8 +110,6 @@ static inline int errno_or_else(int fallback) {
                 return ERRNO_IS_NEG_##name(-ABS(r));      \
         }
 
-assert_cc(INT_MAX <= INTMAX_MAX);
-
 /* For send()/recv() or read()/write(). */
 static inline bool ERRNO_IS_NEG_TRANSIENT(intmax_t r) {
         return IN_SET(r,
index 59c43e8140f43201c6d69b47f5bc9eec0d2f051e..82dd9d31e7ea80910d2d4dbc834e139e66c2f840 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <dirent.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdbool.h>
 #include <stdio.h>
index b122c300b80b3f5e167bcc21aec15fb179d18f93..6540fa5dfc3802871c2c07ce3c4ba1f9b76cef92 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <string.h>
+#include <sys/sysmacros.h>
 
 #include "hash-funcs.h"
 #include "path-util.h"
index 1d8e60330c25645a5b54607d559f42b267259a89..a08a4697ac3aa2e9ea2415e7eb09d46f18d66146 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <ctype.h>
 #include <errno.h>
+#include <limits.h>
 #include <stdint.h>
 #include <stdlib.h>
 
index 3add1bddd086ff74296543a7960970c2bf618966..49cd0f67e10a37fd638a74e44ae1376614e96dcd 100644 (file)
@@ -1,5 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <errno.h>
+
+#include "assert-util.h"
 #include "ioprio-util.h"
 #include "parse-util.h"
 #include "string-table.h"
index 5cc3cc2f93d5b9282b3935eece1530ad297294bd..27b84d2cdb9fbe0947a1c822fb1e66d25e332635 100644 (file)
@@ -1,5 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <errno.h>
+#include <limits.h>
+
 #include "alloc-util.h"
 #include "iovec-util.h"
 #include "iovec-wrapper.h"
index 6bae653188a3d1eeedea3c6b884e339144bb5d8f..b922fd2f191ef3f363a3342f8441072862e29595 100644 (file)
@@ -3,6 +3,7 @@
 #include <errno.h>
 #include <stddef.h>
 
+#include "assert-util.h"
 #include "label.h"
 #include "macro.h"
 
index 81fe8d10843dee056d6e4e719bc30feb217663ec..da84799cf134cb07f394b1fb89ca4f7f7a15f315 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <libintl.h>
 #include <locale.h>
 #include <stdbool.h>
index 845a458f3ed576f772f1d6e4c86f11f93f8e7602..b0e8ef29892e231aabb25b601e2480ed4fba1568 100644 (file)
@@ -1,12 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 /* Some structures we reference but don't want to pull in headers for */
index 9cee1868a5c12860c8ec728aac40719e478bf34c..9391fc5e88ca64b20edb36d1bbf491f920cd5bed 100644 (file)
@@ -1,13 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <assert.h>
-#include <errno.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <sys/sysmacros.h>
-#include <sys/types.h>
-
 #include "constants.h"
 #include "macro-fundamental.h"
 
 /* test harness */
 #define EXIT_TEST_SKIP 77
 
-/* builtins */
-#if __SIZEOF_INT__ == 4
-#define BUILTIN_FFS_U32(x) __builtin_ffs(x);
-#elif __SIZEOF_LONG__ == 4
-#define BUILTIN_FFS_U32(x) __builtin_ffsl(x);
-#else
-#error "neither int nor long are four bytes long?!?"
-#endif
-
 static inline uint64_t u64_multiply_safe(uint64_t a, uint64_t b) {
         if (_unlikely_(a != 0 && b > (UINT64_MAX / a)))
                 return 0; /* overflow */
@@ -66,29 +50,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
         return 1UL << (sizeof(u) * 8 - __builtin_clzl(u - 1UL));
 }
 
-static inline size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
-        size_t m;
-
-        /* Round up allocation sizes a bit to some reasonable, likely larger value. This is supposed to be
-         * used for cases which are likely called in an allocation loop of some form, i.e. that repetitively
-         * grow stuff, for example strv_extend() and suchlike.
-         *
-         * Note the difference to GREEDY_REALLOC() here, as this helper operates on a single size value only,
-         * and rounds up to next multiple of 2, needing no further counter.
-         *
-         * Note the benefits of direct ALIGN_POWER2() usage: type-safety for size_t, sane handling for very
-         * small (i.e. <= 2) and safe handling for very large (i.e. > SSIZE_MAX) values. */
-
-        if (l <= 2)
-                return 2; /* Never allocate less than 2 of something.  */
-
-        m = ALIGN_POWER2(l);
-        if (m == 0) /* overflow? */
-                return l;
-
-        return m;
-}
-
 /*
  * container_of - cast a member of a structure out to the containing structure
  * @ptr: the pointer to the member.
@@ -102,12 +63,6 @@ static inline size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
                 (type*)( (char *)UNIQ_T(A, uniq) - offsetof(type, member) ); \
         })
 
-#define return_with_errno(r, err)                     \
-        do {                                          \
-                errno = ABS(err);                     \
-                return r;                             \
-        } while (false)
-
 #define PTR_TO_INT(p) ((int) ((intptr_t) (p)))
 #define INT_TO_PTR(u) ((void *) ((intptr_t) (u)))
 #define PTR_TO_UINT(p) ((unsigned) ((uintptr_t) (p)))
index 443fc3a8ab5b65a0948a265d5057a71437121ac2..7a86cac5bc94c14cf15111efc4134d778c3a220c 100644 (file)
@@ -2,6 +2,7 @@
 #pragma once
 
 #include <inttypes.h>
+#include <limits.h>
 #include <malloc.h>
 #include <stdbool.h>
 #include <string.h>
index d6f2f58e9fd5062f8bd5f8abef04570f37ff98bc..6a6c15a2e43ebf664275774c14eeadb81e0bb62b 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdbool.h>
 #include <string.h>
 
+#include "assert-util.h"
 #include "set.h"
 
 #define NULSTR_FOREACH(i, l)                                    \
index e975d6e3e3cccdcf1a660a02ccdf678878ce4cd0..dd70d59dba09f002a557fa35f8e33ec2266f15c7 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <errno.h>
 #include <inttypes.h>
+#include <limits.h>
 
 #include "macro.h"
 
index 59a4e3920420d822852f872266f953d137a8f160..6084f9cf89fe97f211c5b865e4b5a55fe914ceef 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <signal.h>
 
 #include "macro.h"
index df8c95c562ac7987dc59996c436b828071978621..351fcac3bdd27dfa6dfd113f8ac7bb05bf118f28 100644 (file)
@@ -1,7 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
 #include <sys/time.h>
 
+#include "assert-util.h"
 #include "macro.h"
 #include "ratelimit.h"
 
index 1017a550fca4b74c7c42e2c75a2a34d3d49806ab..c4c2e85cec3c7464d4ac8e8e203697c81b9a8c03 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <errno.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
index 9c818bd74706dd42652885c4531ace674edcb19a..2820f2327c3757eaed08b7772e11ab999fe553b3 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdlib.h>
 
+#include "assert-util.h"
 #include "macro.h"
 
 /* This is the same as glibc's internal __compar_d_fn_t type. glibc exports a public comparison_fn_t, for the
index 2c7c75628f6626155b6d15bf7a577a8367491c12..f167d6413ec81d918e8e49fa20607ede7e8c9255 100644 (file)
@@ -2,6 +2,8 @@
 
 #pragma once
 
+#include <errno.h>
+
 #include "macro.h"
 #include "memory-util.h"
 
index 8f2b4cb15b20b40d8b7a855ed1610e59ce80e9a8..30c912adb66287aef17ba9b8bdff645d55a0b9b4 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <errno.h>
+
 #include "parse-util.h"
 #include "string-table.h"
 #include "string-util.h"
index e00a5f59774f95328a1b096adc872e44c27b3703..17fac1bfab5079e06bcae6398cde2803d8c064e2 100644 (file)
@@ -4,6 +4,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <string.h>
+#include <sys/types.h>
 
 #include "alloc-util.h"
 #include "macro.h"
index 0371922e3980ff55d51bb771672c15bcfffa7dcb..18194f70d976cda039b1275892310f7931daa924 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
 #include <syslog.h>
 
 #include "sd-id128.h"
index 3f6e3c9f41cea92f1c27875eee782c259e475af4..83d7e660ac80c27cf1fa1bf68843859b98237933 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <inttypes.h>
 #include <stdbool.h>
 #include <stddef.h>
index c7f354506c243577da9df2463aa8d9cf357cdc2f..99d83f54628906d7a68459028a2bf9972463b190 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
+
 #include "bcd.h"
 #include "bootspec-fundamental.h"
 #include "console.h"
index e8dbe297ed26144111b803c1fee992a8796f89ce..4b9c3181c087b9f67eb468bd9733543d9c32dfd8 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
+
 #include "efi-string.h"
 
 #if SD_BOOT
index 1a0feb633e3a945362dda0ff42d08994a147abd3..c5cd6a57cabf077e0ed3b85f86a7b8ef91b6a328 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
+
 #include "chid.h"
 #include "devicetree.h"
 #include "efi-firmware.h"
index 4793391b06d21182d2d68a02d54a0bf38edc8891..9cc115a1f684da023073bea0c7d09a91f5e52fcd 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
+
 #include "cpio.h"
 #include "device-path-util.h"
 #include "devicetree.h"
index 97a295e1e57223143ae3252577669527d8ae5702..ffa2280e609cd85a6d39eff0756df9bf5dd8e8e4 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 
index aba58612f7cfe451e108311c70d508a34dad0a68..06def183b97e400ea86c9d63b8b70d3ba4a70036 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "assert-util.h"
 #include "unit-dependency-atom.h"
 
 static const UnitDependencyAtom atom_map[_UNIT_DEPENDENCY_MAX] = {
index 597228f13954e08cca8b1f77f6b769f9cd1cf086..54b3e6a6510d4c074be1dbe645191317af591480 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <limits.h>
 #include <stdalign.h>
 #include <stdbool.h>
 #include <stddef.h>
index 6ad6cf7a676114613418d2b1ea1373275d08ab13..160d9e62a6eb6a93fb853554f2e40d001e254b56 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #if HAVE_BZIP2
 #include <bzlib.h>
 #endif
index fc34f306031ee287c5a7dfe90434fb0eb7342ccb..6c186f6128f8ee1d85c44776ce1b0bf5a8688e39 100644 (file)
@@ -3,6 +3,7 @@
 #include <zlib.h>
 
 #include "alloc-util.h"
+#include "assert-util.h"
 #include "btrfs-util.h"
 #include "qcow2-util.h"
 #include "sparse-endian.h"
index 78c743648bbcaa789c8eceb57df4c566c66f7762..16693bcad6b8a65026c53050a4f7c5ff320d78d5 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "sd-bus.h"
 
+#include "assert-util.h"
 #include "bus-signature.h"
 #include "bus-type.h"
 
index 02576077b0b67c22f5269728631dda32438ac34b..28cccca21a7641647c765a6b643dcebc8e190e83 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #include "sd-id128.h"
 
 #include "macro.h"
index 0fb5e87df710bcc594c40352bc02d26f17d77809..a4beb54cba5518e4fa608b6e1c67b04e55adb373 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <sys/sysmacros.h>
+
 #include "alloc-util.h"
 #include "devnum-util.h"
 #include "env-util.h"
index ae62138c8f32a7ac9d3c563f76a8b9744224d064..4ad1489307d0fa9511d351b2e7b4d48341ea6e66 100644 (file)
@@ -22,6 +22,7 @@
 #include "alloc-util.h"
 #include "device-private.h"
 #include "device-util.h"
+#include "errno-util.h"
 #include "libudev-device-internal.h"
 #include "libudev-list-internal.h"
 #include "parse-util.h"
index 270df0fa66786526a1f443720e7b19c291549721..6afcc68256b8abc3cdd67d4b57cd24fb2def99ba 100644 (file)
@@ -16,6 +16,7 @@
 #include "alloc-util.h"
 #include "device-enumerator-private.h"
 #include "device-util.h"
+#include "errno-util.h"
 #include "libudev-device-internal.h"
 #include "libudev-list-internal.h"
 
index 7144905e853bafe1487e0ae0ebd226448310d1a9..edc1c664a85db677df22c5ece5aed04f0d4b6c9a 100644 (file)
@@ -5,6 +5,8 @@
 #include "sd-hwdb.h"
 
 #include "alloc-util.h"
+#include "assert-util.h"
+#include "errno-util.h"
 #include "hwdb-util.h"
 #include "libudev-list-internal.h"
 #include "log.h"
index 1d5a024b79fd52fbc3f58320eec4d437ef85fb44..c4aa78dd65edb3663a4bd088a181ac1ef7599649 100644 (file)
@@ -9,6 +9,7 @@
 #include "libudev.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "fd-util.h"
 #include "io-util.h"
 #include "udev-util.h"
index a6004e3999fd0d4da8107d9c60c8f6e791a64180..ae3260633aeb5e97a691ef4b0b72064943954cb5 100644 (file)
@@ -9,6 +9,7 @@
 #include "libudev.h"
 
 #include "alloc-util.h"
+#include "errno-util.h"
 #include "fd-util.h"
 #include "log.h"
 #include "string-util.h"
index 7c8c397d6ce4deeed78e781a7d290d3e3230d4f3..089326c396285cb5ec236483f4435566896da7f9 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #include "in-addr-util.h"
 #include "macro.h"
 
index 3781182946453cae19576dbdd2d0f1cbe4ed090d..ce9b5ecdae85c611c7f9145bdec348cd05040ef0 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright © 2019 VMware, Inc. */
 
 #include "alloc-util.h"
+#include "assert-util.h"
 #include "extract-word.h"
 #include "fileio.h"
 #include "parse-util.h"
index 657526b4708b26b2a48c4a57dce4c06431e4cc4c..590e8f4008e576bf105f046e995f98e223cfff4a 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #include "macro.h"
 
 /* DNS record types, taken from
index e88bf9d1116418cd1d3167dd5ad8eaca47bee8e0..b1b511aed5e32022988d37813a49cfe7c9a5b5ae 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 
 #include "dlfcn-util.h"
index 377a2778511555fefdac5d3d5d4d3562b8910a86..5446eb0f916b4e0dc2bcfb115162418918701b72 100644 (file)
@@ -2,6 +2,8 @@
 
 #if HAVE_BLKID
 
+#include <errno.h>
+
 #include "blkid-util.h"
 #include "string-util.h"
 
index 557912c73fee602b67671b69f905308e04de5db4..84b18942ee64da431510a0ed7df501389f8b1e2c 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <linux/if_bonding.h>
 #include <netinet/in.h>
 
index 80d2b5371c9bfcc55bb990dc225da00d1cea6675..9ceb976b0b65d50573ed32e01a911ff427a8a5c1 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "assert-util.h"
 #include "bus-locator.h"
 #include "macro.h"
 
index 9d714c0fff7fc9587f883dcf957de1bb08c3123b..e8258de95d13cae180302e6d3f4ea037bfe1992d 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <math.h>
 
+#include "assert-util.h"
 #include "color-util.h"
 #include "macro.h"
 
index 84b927384144c8f7e282ddae5e678d44fddb65ea..0644ec28f51e7b0252cfc181eceae4ddef642413 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 
index fb006e38ed2654468c648b94e349797aef2a7700..2f153a97326525c729b8c97c71146c79ba7d0420 100644 (file)
@@ -9,6 +9,7 @@
 #include <sys/file.h>
 #include <sys/ioctl.h>
 #include <sys/sendfile.h>
+#include <sys/sysmacros.h>
 #include <sys/xattr.h>
 #include <unistd.h>
 
index 4f54bb94c003708db65a03ab0e83b1a7cca8b88f..a72db4b4e550241232dc56c2df0989591f6a5866 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+#include <pwd.h>
+
 #include "macro.h"
 
 typedef enum CoredumpFilter {
index e0e0f7aac11f9d9d1a811048a88babec99b367af..0ac195c86f56f19f26471098fb9a2ec9b165d335 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <sys/sysmacros.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
index 822800cc227a3914359d40742628aeb002252717..986f2cfd9e34215178137380c1639955c809957c 100644 (file)
@@ -8,6 +8,7 @@
 #  include <stringprep.h>
 #endif
 
+#include <errno.h>
 #include <inttypes.h>
 
 #if HAVE_LIBIDN2 || HAVE_LIBIDN
index 98b99e371fc42f8b4dcac9a547d6be35d976a7a8..91bc3083e46a3510d091ed1d2f566d3f76159270 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <stdbool.h>
 
 #include "macro.h"
index ca7b0b40f5219c18490e2966b6c3a2f15db67b41..bc286d9d8815fba8a7c3daa8c09962b46097d7de 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
 #include <linux/if_link.h>
 #include <netinet/in.h>
 
index 1efdacdd36846747695c2f2ff54f4232ea6f2e2d..2695b18a7fb0386d3406bd9a268b7de0f6b4d9f5 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #include "dlfcn-util.h"
 
 #if HAVE_LIBARCHIVE
index 4a0d8f8cbea7e691b1cae7796da64f3d938b077b..18aec372a7fcea790e8826d789b4e094486901af 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #include "iovec-util.h"
 #include "macro.h"
 
index fe38801001bccf719772cd855be71f8c933df41e..d6cab523591ac6959e815638ab021f73d48dad7b 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
+#include <errno.h>
+
 #include "list.h"
 #include "macro.h"
 #include "memory-util.h"
index 3233f05dfc50490ca82d7d92ec82640137eb7c2e..6c733700765795070e2ebe96520b1a6de3429562 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <errno.h>
+
 #include "alloc-util.h"
 #include "memory-util.h"
 #include "random-util.h"
index 4ed4a3319894c832926e1e5447b1924ad7386b67..979c3f5be9a4ea602a31a197c075a21316a0fd89 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/socket.h>
 #include <sys/types.h>
 
+#include "assert-util.h"
 #include "label-util.h"
 #include "macro.h"
 
index bea4f7f1ee699495f7e6b7ca0869a45325bfa46a..bd095992e9b0cd2ad30b8230e71d6021a066dd17 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "alloc-util.h"
+#include "assert-util.h"
 #include "fileio.h"
 #include "macro.h"
 #include "smbios11.h"
index 44e26e8e244fe1e402b2cc760dd6ee0c5781b2d1..cb31edcdc647a7b155b3be2deca90473189d3ec6 100644 (file)
@@ -4,6 +4,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 
 #include "alloc-util.h"
 #include "dirent-util.h"
index 0670bb7f8e40c7f8890f9b4f37a2e601412597b7..e3c3149db121d98f3e533ea173554c7023306d06 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <sys/file.h>
+#include <sys/sysmacros.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
index 8dd5746495ee64a5801fd1418408032f1f6a4116..3fe2f26274c905ce33fe11bd485ae3201d140d32 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <float.h>
+#include <sys/sysmacros.h>
 
 #include "sd-json.h"
 
index c3f1bdee89d959c4dab1862f274090f603e313bc..fe90341dc815fcc06d89d133cf17d83fb3f3ee84 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <limits.h>
 #include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>