diff options
Diffstat (limited to 'src/systemd/src')
101 files changed, 331 insertions, 7 deletions
diff --git a/src/systemd/src/basic/alloc-util.c b/src/systemd/src/basic/alloc-util.c index 0c6a15c958..a849e13938 100644 --- a/src/systemd/src/basic/alloc-util.c +++ b/src/systemd/src/basic/alloc-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdint.h> #include <string.h> diff --git a/src/systemd/src/basic/alloc-util.h b/src/systemd/src/basic/alloc-util.h index f5097ea117..f9be5e85c1 100644 --- a/src/systemd/src/basic/alloc-util.h +++ b/src/systemd/src/basic/alloc-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <alloca.h> #include <stddef.h> #include <stdlib.h> diff --git a/src/systemd/src/basic/async.h b/src/systemd/src/basic/async.h index 7f1ef79532..44b886a661 100644 --- a/src/systemd/src/basic/async.h +++ b/src/systemd/src/basic/async.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + int asynchronous_job(void* (*func)(void *p), void *arg); int asynchronous_sync(void); diff --git a/src/systemd/src/basic/escape.c b/src/systemd/src/basic/escape.c index ab282efa3c..fe1737e5b9 100644 --- a/src/systemd/src/basic/escape.c +++ b/src/systemd/src/basic/escape.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdlib.h> #include <string.h> diff --git a/src/systemd/src/basic/escape.h b/src/systemd/src/basic/escape.h index c710f01743..da8f71439b 100644 --- a/src/systemd/src/basic/escape.h +++ b/src/systemd/src/basic/escape.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/fd-util.c b/src/systemd/src/basic/fd-util.c index 9759cac23c..3828148ca7 100644 --- a/src/systemd/src/basic/fd-util.c +++ b/src/systemd/src/basic/fd-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <fcntl.h> #include <sys/resource.h> @@ -28,7 +30,9 @@ #include "fd-util.h" #include "macro.h" +#if 0 /* NM_IGNORED */ #include "missing.h" +#endif /* NM_IGNORED */ #include "parse-util.h" #include "path-util.h" #include "socket-util.h" @@ -186,6 +190,7 @@ int fd_cloexec(int fd, bool cloexec) { return 0; } +#if 0 /* NM_IGNORED */ _pure_ static bool fd_in_set(int fd, const int fdset[], unsigned n_fdset) { unsigned i; @@ -321,6 +326,7 @@ int same_fd(int a, int b) { return fa == fb; } +#endif /* NM_IGNORED */ void cmsg_close_all(struct msghdr *mh) { struct cmsghdr *cmsg; diff --git a/src/systemd/src/basic/fd-util.h b/src/systemd/src/basic/fd-util.h index 5ce1592eeb..3614dc7882 100644 --- a/src/systemd/src/basic/fd-util.h +++ b/src/systemd/src/basic/fd-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <dirent.h> #include <stdbool.h> #include <stdio.h> diff --git a/src/systemd/src/basic/fileio.c b/src/systemd/src/basic/fileio.c index 3a237252b5..913c629368 100644 --- a/src/systemd/src/basic/fileio.c +++ b/src/systemd/src/basic/fileio.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <fcntl.h> #include <limits.h> @@ -42,7 +44,9 @@ #include "parse-util.h" #include "path-util.h" #include "random-util.h" +#if 0 /* NM_IGNORED */ #include "stdio-util.h" +#endif /* NM_IGNORED */ #include "string-util.h" #include "strv.h" #include "time-util.h" @@ -590,7 +594,7 @@ static int parse_env_file_push( va_list aq, *ap = userdata; if (!utf8_is_valid(key)) { - _cleanup_free_ char *p; + _cleanup_free_ char *p = NULL; p = utf8_escape_invalid(key); log_error("%s:%u: invalid UTF-8 in key '%s', ignoring.", strna(filename), line, p); @@ -598,7 +602,7 @@ static int parse_env_file_push( } if (value && !utf8_is_valid(value)) { - _cleanup_free_ char *p; + _cleanup_free_ char *p = NULL; p = utf8_escape_invalid(value); log_error("%s:%u: invalid UTF-8 value for key %s: '%s', ignoring.", strna(filename), line, key, p); @@ -942,6 +946,7 @@ DIR *xopendirat(int fd, const char *name, int flags) { return d; } +#if 0 /* NM_IGNORED */ static int search_and_fopen_internal(const char *path, const char *mode, const char *root, char **search, FILE **_f) { char **i; @@ -1023,6 +1028,7 @@ int search_and_fopen_nulstr(const char *path, const char *mode, const char *root return search_and_fopen_internal(path, mode, root, s, _f); } +#endif /* NM_IGNORED */ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) { FILE *f; @@ -1071,7 +1077,7 @@ int fflush_and_check(FILE *f) { /* This is much like like mkostemp() but is subject to umask(). */ int mkostemp_safe(char *pattern, int flags) { - _cleanup_umask_ mode_t u; + _cleanup_umask_ mode_t u = 0; int fd; assert(pattern); @@ -1218,6 +1224,7 @@ int tempfn_random_child(const char *p, const char *extra, char **ret) { return 0; } +#if 0 /* NM_IGNORED */ int write_timestamp_file_atomic(const char *fn, usec_t n) { char ln[DECIMAL_STR_MAX(n)+2]; @@ -1231,6 +1238,7 @@ int write_timestamp_file_atomic(const char *fn, usec_t n) { return write_string_file(fn, ln, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC); } +#endif /* NM_IGNORED */ int read_timestamp_file(const char *fn, usec_t *ret) { _cleanup_free_ char *ln = NULL; diff --git a/src/systemd/src/basic/fileio.h b/src/systemd/src/basic/fileio.h index 95e8698941..daaa78027d 100644 --- a/src/systemd/src/basic/fileio.h +++ b/src/systemd/src/basic/fileio.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <dirent.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/fs-util.c b/src/systemd/src/basic/fs-util.c index fb760abe18..741bd31f70 100644 --- a/src/systemd/src/basic/fs-util.c +++ b/src/systemd/src/basic/fs-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <dirent.h> #include <errno.h> #include <stddef.h> @@ -30,20 +32,26 @@ #include <unistd.h> #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "dirent-util.h" +#endif /* NM_IGNORED */ #include "fd-util.h" #include "fileio.h" #include "fs-util.h" #include "log.h" #include "macro.h" +#if 0 /* NM_IGNORED */ #include "missing.h" #include "mkdir.h" +#endif /* NM_IGNORED */ #include "parse-util.h" #include "path-util.h" #include "string-util.h" #include "strv.h" #include "time-util.h" +#if 0 /* NM_IGNORED */ #include "user-util.h" +#endif /* NM_IGNORED */ #include "util.h" int unlink_noerrno(const char *path) { @@ -57,6 +65,7 @@ int unlink_noerrno(const char *path) { return 0; } +#if 0 /* NM_IGNORED */ int rmdir_parents(const char *path, const char *stop) { size_t l; int r = 0; @@ -302,6 +311,7 @@ int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) { return 0; } +#endif /* NM_IGNORED */ int fchmod_umask(int fd, mode_t m) { mode_t u; @@ -314,6 +324,7 @@ int fchmod_umask(int fd, mode_t m) { return r; } +#if 0 /* NM_IGNORED */ int fd_warn_permissions(const char *path, int fd) { struct stat st; @@ -512,3 +523,4 @@ int get_files_in_directory(const char *path, char ***list) { return n; } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/basic/fs-util.h b/src/systemd/src/basic/fs-util.h index 67ed214b51..d13c0194b1 100644 --- a/src/systemd/src/basic/fs-util.h +++ b/src/systemd/src/basic/fs-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <fcntl.h> #include <limits.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/hashmap.c b/src/systemd/src/basic/hashmap.c index 286ddfef5b..4ebb73b539 100644 --- a/src/systemd/src/basic/hashmap.c +++ b/src/systemd/src/basic/hashmap.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdint.h> #include <stdlib.h> @@ -29,7 +31,9 @@ #include "hashmap.h" #include "macro.h" #include "mempool.h" +#if 0 /* NM_IGNORED */ #include "process-util.h" +#endif /* NM_IGNORED */ #include "random-util.h" #include "set.h" #include "siphash24.h" diff --git a/src/systemd/src/basic/hashmap.h b/src/systemd/src/basic/hashmap.h index 708811124b..0485e1d493 100644 --- a/src/systemd/src/basic/hashmap.h +++ b/src/systemd/src/basic/hashmap.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <limits.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/hexdecoct.c b/src/systemd/src/basic/hexdecoct.c index 1e907de228..1f257bd53e 100644 --- a/src/systemd/src/basic/hexdecoct.c +++ b/src/systemd/src/basic/hexdecoct.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <ctype.h> #include <errno.h> #include <stdint.h> diff --git a/src/systemd/src/basic/hexdecoct.h b/src/systemd/src/basic/hexdecoct.h index d9eb54a8a1..ec4115f24e 100644 --- a/src/systemd/src/basic/hexdecoct.h +++ b/src/systemd/src/basic/hexdecoct.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> #include <stddef.h> #include <stdio.h> diff --git a/src/systemd/src/basic/hostname-util.c b/src/systemd/src/basic/hostname-util.c index 795afb6d00..50f81925ee 100644 --- a/src/systemd/src/basic/hostname-util.c +++ b/src/systemd/src/basic/hostname-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <bits/local_lim.h> #include <errno.h> #include <limits.h> @@ -164,6 +166,7 @@ bool is_localhost(const char *hostname) { endswith_no_case(hostname, ".localdomain."); } +#if 0 /* NM_IGNORED */ bool is_gateway_hostname(const char *hostname) { assert(hostname); @@ -224,3 +227,4 @@ int read_hostname_config(const char *path, char **hostname) { *hostname = name; return 0; } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/basic/hostname-util.h b/src/systemd/src/basic/hostname-util.h index d4f5bfe45e..a2e6920095 100644 --- a/src/systemd/src/basic/hostname-util.h +++ b/src/systemd/src/basic/hostname-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> #include "macro.h" diff --git a/src/systemd/src/basic/in-addr-util.c b/src/systemd/src/basic/in-addr-util.c index 5143dddf8f..5027f401b3 100644 --- a/src/systemd/src/basic/in-addr-util.c +++ b/src/systemd/src/basic/in-addr-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include <endian.h> #include <errno.h> diff --git a/src/systemd/src/basic/in-addr-util.h b/src/systemd/src/basic/in-addr-util.h index bcc116c783..f94aba8385 100644 --- a/src/systemd/src/basic/in-addr-util.h +++ b/src/systemd/src/basic/in-addr-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <netinet/in.h> #include <stddef.h> #include <sys/socket.h> diff --git a/src/systemd/src/basic/io-util.c b/src/systemd/src/basic/io-util.c index e83e7cec72..c7bb1e789a 100644 --- a/src/systemd/src/basic/io-util.c +++ b/src/systemd/src/basic/io-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <limits.h> #include <poll.h> diff --git a/src/systemd/src/basic/io-util.h b/src/systemd/src/basic/io-util.h index 5f77a556c0..a626096567 100644 --- a/src/systemd/src/basic/io-util.h +++ b/src/systemd/src/basic/io-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/list.h b/src/systemd/src/basic/list.h index 760abcdab3..3ac38418f2 100644 --- a/src/systemd/src/basic/list.h +++ b/src/systemd/src/basic/list.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + /* The head of the linked list. Use this in the structure that shall * contain the head of the linked list */ #define LIST_HEAD(t,name) \ diff --git a/src/systemd/src/basic/log.h b/src/systemd/src/basic/log.h index cda1e45cc8..bc316189c0 100644 --- a/src/systemd/src/basic/log.h +++ b/src/systemd/src/basic/log.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdarg.h> #include <stdbool.h> @@ -76,6 +78,7 @@ void log_close_console(void); void log_parse_environment(void); +#if 0 /* NM_IGNORED */ int log_internal( int level, int error, @@ -163,6 +166,7 @@ void log_assert_failed_return( ? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ : -abs(_e); \ }) +#endif /* NM_IGNORED */ #define log_full(level, ...) log_full_errno(level, 0, __VA_ARGS__) diff --git a/src/systemd/src/basic/macro.h b/src/systemd/src/basic/macro.h index 5088e6720d..222f3c42fd 100644 --- a/src/systemd/src/basic/macro.h +++ b/src/systemd/src/basic/macro.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <assert.h> #include <inttypes.h> #include <stdbool.h> @@ -46,6 +48,7 @@ #define _alignas_(x) __attribute__((aligned(__alignof(x)))) #define _cleanup_(x) __attribute__((cleanup(x))) +#if (defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) || defined (__clang__) /* Temporarily disable some warnings */ #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \ _Pragma("GCC diagnostic push"); \ @@ -73,6 +76,14 @@ #define REENABLE_WARNING \ _Pragma("GCC diagnostic pop") +#else +#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT +#define DISABLE_WARNING_FORMAT_NONLITERAL +#define DISABLE_WARNING_MISSING_PROTOTYPES +#define DISABLE_WARNING_NONNULL +#define DISABLE_WARNING_SHADOW +#define REENABLE_WARNING +#endif /* automake test harness */ #define EXIT_TEST_SKIP 77 @@ -341,7 +352,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { * Don't break on glibc < 2.16 that doesn't define __STDC_NO_THREADS__ * see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53769 */ -#if __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !(defined(__STDC_NO_THREADS__) || (defined(__GNU_LIBRARY__) && __GLIBC__ == 2 && __GLIBC_MINOR__ < 16)) #define thread_local _Thread_local #else #define thread_local __thread @@ -351,7 +362,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) { /* Define C11 noreturn without <stdnoreturn.h> and even on older gcc * compiler versions */ #ifndef noreturn -#if __STDC_VERSION__ >= 201112L +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #define noreturn _Noreturn #else #define noreturn __attribute__((noreturn)) diff --git a/src/systemd/src/basic/mempool.c b/src/systemd/src/basic/mempool.c index 1822d3956f..511b962f15 100644 --- a/src/systemd/src/basic/mempool.c +++ b/src/systemd/src/basic/mempool.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdint.h> #include <stdlib.h> diff --git a/src/systemd/src/basic/mempool.h b/src/systemd/src/basic/mempool.h index 42f473bee1..e9753adb7b 100644 --- a/src/systemd/src/basic/mempool.h +++ b/src/systemd/src/basic/mempool.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stddef.h> struct pool; diff --git a/src/systemd/src/basic/parse-util.c b/src/systemd/src/basic/parse-util.c index 618ef5d564..86aec95c5f 100644 --- a/src/systemd/src/basic/parse-util.c +++ b/src/systemd/src/basic/parse-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <inttypes.h> #include <locale.h> @@ -28,7 +30,9 @@ #include <xlocale.h> #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "extract-word.h" +#endif /* NM_IGNORED */ #include "macro.h" #include "parse-util.h" #include "string-util.h" @@ -233,6 +237,7 @@ int parse_size(const char *t, uint64_t base, uint64_t *size) { return 0; } +#if 0 /* NM_IGNORED */ int parse_range(const char *t, unsigned *lower, unsigned *upper) { _cleanup_free_ char *word = NULL; unsigned l, u; @@ -269,6 +274,7 @@ int parse_range(const char *t, unsigned *lower, unsigned *upper) { *upper = u; return 0; } +#endif /* NM_IGNORED */ char *format_bytes(char *buf, size_t l, uint64_t t) { unsigned i; diff --git a/src/systemd/src/basic/parse-util.h b/src/systemd/src/basic/parse-util.h index af439cfaa7..fbdf1e436c 100644 --- a/src/systemd/src/basic/parse-util.h +++ b/src/systemd/src/basic/parse-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <limits.h> #include <stddef.h> diff --git a/src/systemd/src/basic/path-util.c b/src/systemd/src/basic/path-util.c index 61fab0e087..14dc35dbf0 100644 --- a/src/systemd/src/basic/path-util.c +++ b/src/systemd/src/basic/path-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <limits.h> #include <stdio.h> @@ -34,17 +36,24 @@ #undef basename #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "extract-word.h" +#endif /* NM_IGNORED */ #include "fs-util.h" #include "log.h" #include "macro.h" +#if 0 /* NM_IGNORED */ #include "missing.h" +#endif /* NM_IGNORED */ #include "path-util.h" +#if 0 /* NM_IGNORED */ #include "stat-util.h" +#endif /* NM_IGNORED */ #include "string-util.h" #include "strv.h" #include "time-util.h" +#if 0 /* NM_IGNORED */ bool path_is_absolute(const char *p) { return p[0] == '/'; } @@ -316,6 +325,7 @@ char **path_strv_resolve_uniq(char **l, const char *prefix) { return strv_uniq(l); } +#endif /* NM_IGNORED */ char *path_kill_slashes(char *path) { char *f, *t; @@ -352,6 +362,7 @@ char *path_kill_slashes(char *path) { return path; } +#if 0 /* NM_IGNORED */ char* path_startswith(const char *path, const char *prefix) { assert(path); assert(prefix); @@ -687,6 +698,7 @@ char* dirname_malloc(const char *path) { return dir2; } +#endif /* NM_IGNORED */ bool filename_is_valid(const char *p) { const char *e; @@ -710,6 +722,7 @@ bool filename_is_valid(const char *p) { return true; } +#if 0 /* NM_IGNORED */ bool path_is_safe(const char *p) { if (isempty(p)) @@ -797,3 +810,4 @@ bool is_device_path(const char *path) { path_startswith(path, "/dev/") || path_startswith(path, "/sys/"); } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/basic/path-util.h b/src/systemd/src/basic/path-util.h index 84472d38c7..2bc23fec5b 100644 --- a/src/systemd/src/basic/path-util.h +++ b/src/systemd/src/basic/path-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <alloca.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/prioq.c b/src/systemd/src/basic/prioq.c index 86c5c0e9b4..4be4ad6e64 100644 --- a/src/systemd/src/basic/prioq.c +++ b/src/systemd/src/basic/prioq.c @@ -29,6 +29,8 @@ * The underlying algorithm used in this implementation is a Heap. */ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdlib.h> diff --git a/src/systemd/src/basic/prioq.h b/src/systemd/src/basic/prioq.h index 6a2451387c..f6a88f0a0b 100644 --- a/src/systemd/src/basic/prioq.h +++ b/src/systemd/src/basic/prioq.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> #include "hashmap.h" diff --git a/src/systemd/src/basic/random-util.c b/src/systemd/src/basic/random-util.c index e1543da5a3..21d9bde7cd 100644 --- a/src/systemd/src/basic/random-util.c +++ b/src/systemd/src/basic/random-util.c @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <elf.h> #include <errno.h> #include <fcntl.h> @@ -32,11 +34,14 @@ #include "fd-util.h" #include "io-util.h" +#if 0 /* NM_IGNORED */ #include "missing.h" +#endif #include "random-util.h" #include "time-util.h" int dev_urandom(void *p, size_t n) { +#if 0 /* NM_IGNORED */ static int have_syscall = -1; _cleanup_close_ int fd = -1; @@ -77,6 +82,9 @@ int dev_urandom(void *p, size_t n) { /* too short read? */ return -ENODATA; } +#else /* NM_IGNORED */ + _cleanup_close_ int fd = -1; +#endif /* NM_IGNORED */ fd = open("/dev/urandom", O_RDONLY|O_CLOEXEC|O_NOCTTY); if (fd < 0) diff --git a/src/systemd/src/basic/random-util.h b/src/systemd/src/basic/random-util.h index 3cee4c5014..1ae76ef03d 100644 --- a/src/systemd/src/basic/random-util.h +++ b/src/systemd/src/basic/random-util.h @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/refcnt.h b/src/systemd/src/basic/refcnt.h index 8a39d69fe4..f7a26192ce 100644 --- a/src/systemd/src/basic/refcnt.h +++ b/src/systemd/src/basic/refcnt.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + /* A type-safe atomic refcounter. * * DO NOT USE THIS UNLESS YOU ACTUALLY CARE ABOUT THREAD SAFETY! */ diff --git a/src/systemd/src/basic/set.h b/src/systemd/src/basic/set.h index 5fd7de08f9..84c5388815 100644 --- a/src/systemd/src/basic/set.h +++ b/src/systemd/src/basic/set.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include "hashmap.h" #include "macro.h" diff --git a/src/systemd/src/basic/siphash24.c b/src/systemd/src/basic/siphash24.c index 060e8ba387..145f64b20f 100644 --- a/src/systemd/src/basic/siphash24.c +++ b/src/systemd/src/basic/siphash24.c @@ -17,6 +17,8 @@ coding style) */ +#include "nm-sd-adapt.h" + #include "macro.h" #include "siphash24.h" #include "unaligned.h" diff --git a/src/systemd/src/basic/siphash24.h b/src/systemd/src/basic/siphash24.h index 3f7e20362b..0cc0163d8f 100644 --- a/src/systemd/src/basic/siphash24.h +++ b/src/systemd/src/basic/siphash24.h @@ -1,5 +1,7 @@ #pragma once +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h index 6da1df68d8..d06a764588 100644 --- a/src/systemd/src/basic/socket-util.h +++ b/src/systemd/src/basic/socket-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <netinet/ether.h> #include <netinet/in.h> #include <stdbool.h> diff --git a/src/systemd/src/basic/sparse-endian.h b/src/systemd/src/basic/sparse-endian.h index c913fda8c5..02de0feca8 100644 --- a/src/systemd/src/basic/sparse-endian.h +++ b/src/systemd/src/basic/sparse-endian.h @@ -21,6 +21,8 @@ #ifndef SPARSE_ENDIAN_H #define SPARSE_ENDIAN_H +#include "nm-sd-adapt.h" + #include <byteswap.h> #include <endian.h> #include <stdint.h> diff --git a/src/systemd/src/basic/string-table.c b/src/systemd/src/basic/string-table.c index 4633a57f44..be02c2f984 100644 --- a/src/systemd/src/basic/string-table.c +++ b/src/systemd/src/basic/string-table.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include "string-table.h" #include "string-util.h" diff --git a/src/systemd/src/basic/string-table.h b/src/systemd/src/basic/string-table.h index 2181a3a767..ee64d34ff9 100644 --- a/src/systemd/src/basic/string-table.h +++ b/src/systemd/src/basic/string-table.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stddef.h> #include <stdio.h> diff --git a/src/systemd/src/basic/string-util.c b/src/systemd/src/basic/string-util.c index 8178c7093f..35e00af9d9 100644 --- a/src/systemd/src/basic/string-util.c +++ b/src/systemd/src/basic/string-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdarg.h> #include <stdint.h> @@ -26,7 +28,9 @@ #include <stdlib.h> #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "gunicode.h" +#endif /* NM_IGNORED */ #include "macro.h" #include "string-util.h" #include "utf8.h" @@ -365,6 +369,7 @@ bool string_has_cc(const char *p, const char *ok) { return false; } +#if 0 /* NM_IGNORED */ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent) { size_t x; char *r; @@ -473,6 +478,7 @@ char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigne char *ellipsize(const char *s, size_t length, unsigned percent) { return ellipsize_mem(s, strlen(s), length, percent); } +#endif /* NM_IGNORED */ bool nulstr_contains(const char*nulstr, const char *needle) { const char *i; diff --git a/src/systemd/src/basic/string-util.h b/src/systemd/src/basic/string-util.h index b59b9b5a71..f6aa458442 100644 --- a/src/systemd/src/basic/string-util.h +++ b/src/systemd/src/basic/string-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <alloca.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/strv.c b/src/systemd/src/basic/strv.c index 0a3d15706f..3862490280 100644 --- a/src/systemd/src/basic/strv.c +++ b/src/systemd/src/basic/strv.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <fnmatch.h> #include <stdarg.h> @@ -28,7 +30,9 @@ #include "alloc-util.h" #include "escape.h" +#if 0 /* NM_IGNORED */ #include "extract-word.h" +#endif /* NM_IGNORED */ #include "string-util.h" #include "strv.h" #include "util.h" @@ -322,6 +326,7 @@ char **strv_split_newlines(const char *s) { return l; } +#if 0 /* NM_IGNORED */ int strv_split_extract(char ***t, const char *s, const char *separators, ExtractFlags flags) { _cleanup_strv_free_ char **l = NULL; size_t n = 0, allocated = 0; @@ -359,6 +364,7 @@ int strv_split_extract(char ***t, const char *s, const char *separators, Extract return (int) n; } +#endif /* NM_IGNORED */ char *strv_join(char **l, const char *separator) { char *r, *e; diff --git a/src/systemd/src/basic/strv.h b/src/systemd/src/basic/strv.h index bb61db2638..d3608af3a4 100644 --- a/src/systemd/src/basic/strv.h +++ b/src/systemd/src/basic/strv.h @@ -21,13 +21,17 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <fnmatch.h> #include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "extract-word.h" +#endif /* NM_IGNORED */ #include "macro.h" #include "util.h" @@ -81,7 +85,9 @@ static inline bool strv_isempty(char * const *l) { char **strv_split(const char *s, const char *separator); char **strv_split_newlines(const char *s); +#if 0 /* NM_IGNORED */ int strv_split_extract(char ***t, const char *s, const char *separators, ExtractFlags flags); +#endif /* NM_IGNORED */ char *strv_join(char **l, const char *separator); char *strv_join_quoted(char **l); diff --git a/src/systemd/src/basic/time-util.c b/src/systemd/src/basic/time-util.c index bfc7cf870c..8ca41f0ca7 100644 --- a/src/systemd/src/basic/time-util.c +++ b/src/systemd/src/basic/time-util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <limits.h> #include <stdlib.h> @@ -178,6 +180,7 @@ struct timespec *timespec_store(struct timespec *ts, usec_t u) { return ts; } +#if 0 /* NM_IGNORED */ usec_t timeval_load(const struct timeval *tv) { assert(tv); @@ -326,6 +329,7 @@ char *format_timestamp_relative(char *buf, size_t l, usec_t t) { buf[l-1] = 0; return buf; } +#endif /* NM_IGNORED */ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) { static const struct { @@ -437,6 +441,7 @@ char *format_timespan(char *buf, size_t l, usec_t t, usec_t accuracy) { return buf; } +#if 0 /* NM_IGNORED */ void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t) { assert(f); @@ -1036,6 +1041,7 @@ int get_timezones(char ***ret) { return 0; } +#endif /* NM_IGNORED */ bool timezone_is_valid(const char *name) { bool slash = false; @@ -1096,6 +1102,7 @@ clockid_t clock_boottime_or_monotonic(void) { return clock; } +#if 0 /* NM_IGNORED */ int get_timezone(char **tz) { _cleanup_free_ char *t = NULL; const char *e; @@ -1144,3 +1151,4 @@ unsigned long usec_to_jiffies(usec_t u) { return DIV_ROUND_UP(u , USEC_PER_SEC / hz); } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/basic/time-util.h b/src/systemd/src/basic/time-util.h index 7321e3c670..760ac2a0e0 100644 --- a/src/systemd/src/basic/time-util.h +++ b/src/systemd/src/basic/time-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <stdbool.h> #include <stddef.h> diff --git a/src/systemd/src/basic/umask-util.h b/src/systemd/src/basic/umask-util.h index 8ed34658b4..aada0540a2 100644 --- a/src/systemd/src/basic/umask-util.h +++ b/src/systemd/src/basic/umask-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> #include <sys/stat.h> #include <sys/types.h> diff --git a/src/systemd/src/basic/unaligned.h b/src/systemd/src/basic/unaligned.h index a8115eaa1f..597c890d4d 100644 --- a/src/systemd/src/basic/unaligned.h +++ b/src/systemd/src/basic/unaligned.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <endian.h> #include <stdint.h> diff --git a/src/systemd/src/basic/utf8.c b/src/systemd/src/basic/utf8.c index 124effd6df..20beb6ea10 100644 --- a/src/systemd/src/basic/utf8.c +++ b/src/systemd/src/basic/utf8.c @@ -43,6 +43,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdbool.h> #include <stdlib.h> diff --git a/src/systemd/src/basic/utf8.h b/src/systemd/src/basic/utf8.h index 16c4b5b55d..32172c3171 100644 --- a/src/systemd/src/basic/utf8.h +++ b/src/systemd/src/basic/utf8.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> #include <stddef.h> #include <stdint.h> diff --git a/src/systemd/src/basic/util.c b/src/systemd/src/basic/util.c index 9e0b576283..43e453ee75 100644 --- a/src/systemd/src/basic/util.c +++ b/src/systemd/src/basic/util.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <alloca.h> #include <dirent.h> #include <errno.h> @@ -37,34 +39,48 @@ #include <unistd.h> #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "build.h" #include "def.h" #include "dirent-util.h" +#endif /* NM_IGNORED */ #include "fd-util.h" #include "fileio.h" +#if 0 /* NM_IGNORED */ #include "formats-util.h" +#endif /* NM_IGNORED */ #include "hashmap.h" #include "hostname-util.h" #include "log.h" #include "macro.h" +#if 0 /* NM_IGNORED */ #include "missing.h" +#endif /* NM_IGNORED */ #include "parse-util.h" #include "path-util.h" +#if 0 /* NM_IGNORED */ #include "process-util.h" +#endif /* NM_IGNORED */ #include "set.h" +#if 0 /* NM_IGNORED */ #include "signal-util.h" #include "stat-util.h" +#endif /* NM_IGNORED */ #include "string-util.h" #include "strv.h" #include "time-util.h" +#if 0 /* NM_IGNORED */ #include "user-util.h" +#endif /* NM_IGNORED */ #include "util.h" /* Put this test here for a lack of better place */ assert_cc(EAGAIN == EWOULDBLOCK); +#if 0 /* NM_IGNORED */ int saved_argc = 0; char **saved_argv = NULL; +#endif /* NM_IGNORED */ size_t page_size(void) { static thread_local size_t pgsz = 0; @@ -80,6 +96,7 @@ size_t page_size(void) { return pgsz; } +#if 0 /* NM_IGNORED */ static int do_execute(char **directories, usec_t timeout, char *argv[]) { _cleanup_hashmap_free_free_ Hashmap *pids = NULL; _cleanup_set_free_free_ Set *seen = NULL; @@ -793,3 +810,4 @@ int version(void) { SYSTEMD_FEATURES); return 0; } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h index 76a06822b7..9393919d66 100644 --- a/src/systemd/src/basic/util.h +++ b/src/systemd/src/basic/util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <alloca.h> #include <errno.h> #include <fcntl.h> @@ -42,9 +44,13 @@ #include <time.h> #include <unistd.h> +#if 0 /* NM_IGNORED */ #include "formats-util.h" +#endif /* NM_IGNORED */ #include "macro.h" +#if 0 /* NM_IGNORED */ #include "missing.h" +#endif /* NM_IGNORED */ #include "time-util.h" size_t page_size(void) _pure_; diff --git a/src/systemd/src/libsystemd-network/arp-util.c b/src/systemd/src/libsystemd-network/arp-util.c index 4660c7ea09..0c89814512 100644 --- a/src/systemd/src/libsystemd-network/arp-util.c +++ b/src/systemd/src/libsystemd-network/arp-util.c @@ -18,6 +18,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <linux/filter.h> #include <arpa/inet.h> diff --git a/src/systemd/src/libsystemd-network/arp-util.h b/src/systemd/src/libsystemd-network/arp-util.h index 63c559f8dd..16af89623f 100644 --- a/src/systemd/src/libsystemd-network/arp-util.h +++ b/src/systemd/src/libsystemd-network/arp-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <netinet/if_ether.h> #include "socket-util.h" diff --git a/src/systemd/src/libsystemd-network/dhcp-identifier.c b/src/systemd/src/libsystemd-network/dhcp-identifier.c index d7ae865557..732199de08 100644 --- a/src/systemd/src/libsystemd-network/dhcp-identifier.c +++ b/src/systemd/src/libsystemd-network/dhcp-identifier.c @@ -19,7 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + +#if 0 /* NM_IGNORED */ #include "libudev.h" +#endif /* NM_IGNORED */ #include "sd-id128.h" #include "dhcp-identifier.h" @@ -27,8 +31,12 @@ #include "network-internal.h" #include "siphash24.h" #include "sparse-endian.h" +#if 0 /* NM_IGNORED */ #include "udev-util.h" #include "virt.h" +#else /* NM_IGNORED */ +#include <net/if.h> +#endif /* NM_IGNORED */ #define SYSTEMD_PEN 43793 #define HASH_KEY SD_ID128_MAKE(80,11,8c,c2,fe,4a,03,ee,3e,d6,0c,6f,36,39,14,09) @@ -59,12 +67,17 @@ int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len) { } int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, void *_id) { +#if 0 /* NM_IGNORED */ /* name is a pointer to memory in the udev_device struct, so must have the same scope */ _cleanup_udev_device_unref_ struct udev_device *device = NULL; +#else /* NM_IGNORED */ + char name_buf[IF_NAMESIZE]; +#endif /* NM_IGNORED */ const char *name = NULL; uint64_t id; +#if 0 /* NM_IGNORED */ if (detect_container() <= 0) { /* not in a container, udev will be around */ _cleanup_udev_unref_ struct udev *udev; @@ -84,6 +97,9 @@ int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, void *_i name = net_get_name(device); } } +#else /* NM_IGNORED */ + name = if_indextoname(ifindex, name_buf); +#endif /* NM_IGNORED */ if (name) id = siphash24(name, strlen(name), HASH_KEY.bytes); diff --git a/src/systemd/src/libsystemd-network/dhcp-identifier.h b/src/systemd/src/libsystemd-network/dhcp-identifier.h index 2291736f8b..106dba393c 100644 --- a/src/systemd/src/libsystemd-network/dhcp-identifier.h +++ b/src/systemd/src/libsystemd-network/dhcp-identifier.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include "sd-id128.h" #include "macro.h" diff --git a/src/systemd/src/libsystemd-network/dhcp-internal.h b/src/systemd/src/libsystemd-network/dhcp-internal.h index 67714fd099..09dcf7e9eb 100644 --- a/src/systemd/src/libsystemd-network/dhcp-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp-internal.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <linux/if_packet.h> #include <net/ethernet.h> #include <net/if_arp.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-lease-internal.h b/src/systemd/src/libsystemd-network/dhcp-lease-internal.h index 9a96be6236..8ce52a7d2c 100644 --- a/src/systemd/src/libsystemd-network/dhcp-lease-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp-lease-internal.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdint.h> #include <linux/if_packet.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-network.c b/src/systemd/src/libsystemd-network/dhcp-network.c index fac25e0fa2..15a0bb7b8b 100644 --- a/src/systemd/src/libsystemd-network/dhcp-network.c +++ b/src/systemd/src/libsystemd-network/dhcp-network.c @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <net/ethernet.h> #include <net/if_arp.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-option.c b/src/systemd/src/libsystemd-network/dhcp-option.c index 1de7f3639c..8c359a4870 100644 --- a/src/systemd/src/libsystemd-network/dhcp-option.c +++ b/src/systemd/src/libsystemd-network/dhcp-option.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <stdint.h> #include <stdio.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-packet.c b/src/systemd/src/libsystemd-network/dhcp-packet.c index 9ff42b155e..88a2161d14 100644 --- a/src/systemd/src/libsystemd-network/dhcp-packet.c +++ b/src/systemd/src/libsystemd-network/dhcp-packet.c @@ -18,6 +18,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <net/ethernet.h> #include <net/if_arp.h> diff --git a/src/systemd/src/libsystemd-network/dhcp-protocol.h b/src/systemd/src/libsystemd-network/dhcp-protocol.h index f65529a00e..0d80a9164e 100644 --- a/src/systemd/src/libsystemd-network/dhcp-protocol.h +++ b/src/systemd/src/libsystemd-network/dhcp-protocol.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <netinet/ip.h> #include <netinet/udp.h> #include <stdint.h> diff --git a/src/systemd/src/libsystemd-network/dhcp6-internal.h b/src/systemd/src/libsystemd-network/dhcp6-internal.h index ecc220f2f6..09cff3c452 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp6-internal.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h b/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h index 3bfb46b96d..6b51658c7e 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h +++ b/src/systemd/src/libsystemd-network/dhcp6-lease-internal.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdint.h> #include "sd-dhcp6-lease.h" diff --git a/src/systemd/src/libsystemd-network/dhcp6-network.c b/src/systemd/src/libsystemd-network/dhcp6-network.c index fd2d60c9d5..e488301904 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-network.c +++ b/src/systemd/src/libsystemd-network/dhcp6-network.c @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <netinet/in.h> #include <netinet/ip6.h> diff --git a/src/systemd/src/libsystemd-network/dhcp6-option.c b/src/systemd/src/libsystemd-network/dhcp6-option.c index 850212aea1..0d61eddb9b 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-option.c +++ b/src/systemd/src/libsystemd-network/dhcp6-option.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <netinet/in.h> #include <string.h> diff --git a/src/systemd/src/libsystemd-network/dhcp6-protocol.h b/src/systemd/src/libsystemd-network/dhcp6-protocol.h index b3a28f88b4..1318c81630 100644 --- a/src/systemd/src/libsystemd-network/dhcp6-protocol.h +++ b/src/systemd/src/libsystemd-network/dhcp6-protocol.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <netinet/ip6.h> #include <netinet/udp.h> diff --git a/src/systemd/src/libsystemd-network/lldp-internal.c b/src/systemd/src/libsystemd-network/lldp-internal.c index 10f12d11a2..87fecd0a3b 100644 --- a/src/systemd/src/libsystemd-network/lldp-internal.c +++ b/src/systemd/src/libsystemd-network/lldp-internal.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include "sd-lldp.h" #include "alloc-util.h" diff --git a/src/systemd/src/libsystemd-network/lldp-internal.h b/src/systemd/src/libsystemd-network/lldp-internal.h index 5d19fa0fea..5496fae76b 100644 --- a/src/systemd/src/libsystemd-network/lldp-internal.h +++ b/src/systemd/src/libsystemd-network/lldp-internal.h @@ -22,6 +22,8 @@ #pragma once +#include "nm-sd-adapt.h" + #include "sd-event.h" #include "list.h" diff --git a/src/systemd/src/libsystemd-network/lldp-network.c b/src/systemd/src/libsystemd-network/lldp-network.c index f483cd9c8e..e7f575a0b2 100644 --- a/src/systemd/src/libsystemd-network/lldp-network.c +++ b/src/systemd/src/libsystemd-network/lldp-network.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <linux/filter.h> #include <linux/if_ether.h> diff --git a/src/systemd/src/libsystemd-network/lldp-network.h b/src/systemd/src/libsystemd-network/lldp-network.h index 74ee13a414..b1e428e7fb 100644 --- a/src/systemd/src/libsystemd-network/lldp-network.h +++ b/src/systemd/src/libsystemd-network/lldp-network.h @@ -22,6 +22,8 @@ #pragma once +#include "nm-sd-adapt.h" + #include "sd-event.h" int lldp_network_bind_raw_socket(int ifindex); diff --git a/src/systemd/src/libsystemd-network/lldp-port.c b/src/systemd/src/libsystemd-network/lldp-port.c index 1f1a49adbf..7374f18d74 100644 --- a/src/systemd/src/libsystemd-network/lldp-port.c +++ b/src/systemd/src/libsystemd-network/lldp-port.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include "alloc-util.h" #include "async.h" #include "lldp-internal.h" diff --git a/src/systemd/src/libsystemd-network/lldp-port.h b/src/systemd/src/libsystemd-network/lldp-port.h index 517b162a67..063eaa275e 100644 --- a/src/systemd/src/libsystemd-network/lldp-port.h +++ b/src/systemd/src/libsystemd-network/lldp-port.h @@ -22,6 +22,8 @@ #pragma once +#include "nm-sd-adapt.h" + #include <net/ethernet.h> #include "sd-event.h" diff --git a/src/systemd/src/libsystemd-network/lldp-tlv.c b/src/systemd/src/libsystemd-network/lldp-tlv.c index 66343147a1..b589402f46 100644 --- a/src/systemd/src/libsystemd-network/lldp-tlv.c +++ b/src/systemd/src/libsystemd-network/lldp-tlv.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include <net/ethernet.h> diff --git a/src/systemd/src/libsystemd-network/lldp-tlv.h b/src/systemd/src/libsystemd-network/lldp-tlv.h index 744dec37f7..7d7459e939 100644 --- a/src/systemd/src/libsystemd-network/lldp-tlv.h +++ b/src/systemd/src/libsystemd-network/lldp-tlv.h @@ -22,6 +22,8 @@ #pragma once +#include "nm-sd-adapt.h" + #include <net/ethernet.h> #include "sd-lldp.h" diff --git a/src/systemd/src/libsystemd-network/lldp.h b/src/systemd/src/libsystemd-network/lldp.h index 19e5cc5f41..974fd8b0e8 100644 --- a/src/systemd/src/libsystemd-network/lldp.h +++ b/src/systemd/src/libsystemd-network/lldp.h @@ -22,6 +22,8 @@ #pragma once +#include "nm-sd-adapt.h" + #define LLDP_MULTICAST_ADDR { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } #define ETHERTYPE_LLDP 0x88cc diff --git a/src/systemd/src/libsystemd-network/network-internal.c b/src/systemd/src/libsystemd-network/network-internal.c index a4d4f1ae2f..579329c750 100644 --- a/src/systemd/src/libsystemd-network/network-internal.c +++ b/src/systemd/src/libsystemd-network/network-internal.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include <linux/if.h> #include <netinet/ether.h> @@ -26,8 +28,10 @@ #include "sd-ndisc.h" #include "alloc-util.h" +#if 0 /* NM_IGNORED */ #include "condition.h" #include "conf-parser.h" +#endif /* NM_IGNORED */ #include "dhcp-lease-internal.h" #include "hexdecoct.h" #include "log.h" @@ -39,6 +43,7 @@ #include "utf8.h" #include "util.h" +#if 0 /* NM_IGNORED */ const char *net_get_name(struct udev_device *device) { const char *name, *field; @@ -336,6 +341,7 @@ int config_parse_hwaddr(const char *unit, return 0; } +#endif /* NM_IGNORED */ void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) { unsigned i; diff --git a/src/systemd/src/libsystemd-network/network-internal.h b/src/systemd/src/libsystemd-network/network-internal.h index 8a30921966..17c2f4fbe7 100644 --- a/src/systemd/src/libsystemd-network/network-internal.h +++ b/src/systemd/src/libsystemd-network/network-internal.h @@ -21,8 +21,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <stdbool.h> +#if 0 /* NM_IGNORED */ #include "condition.h" #include "udev.h" @@ -64,6 +67,7 @@ int config_parse_ifalias(const char *unit, const char *filename, unsigned line, int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result); const char *net_get_name(struct udev_device *device); +#endif /* NM_IGNORED */ void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size); int deserialize_in_addrs(struct in_addr **addresses, const char *string); diff --git a/src/systemd/src/libsystemd-network/sd-dhcp-client.c b/src/systemd/src/libsystemd-network/sd-dhcp-client.c index 4521f8f0b1..23d2c4b011 100644 --- a/src/systemd/src/libsystemd-network/sd-dhcp-client.c +++ b/src/systemd/src/libsystemd-network/sd-dhcp-client.c @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <net/ethernet.h> #include <net/if_arp.h> @@ -404,7 +406,7 @@ static void client_stop(sd_dhcp_client *client, int error) { static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret, uint8_t type, size_t *_optlen, size_t *_optoffset) { - _cleanup_free_ DHCPPacket *packet; + _cleanup_free_ DHCPPacket *packet = NULL; size_t optlen, optoffset, size; be16_t max_size; usec_t time_now; diff --git a/src/systemd/src/libsystemd-network/sd-dhcp-lease.c b/src/systemd/src/libsystemd-network/sd-dhcp-lease.c index e875ba4986..e6caab5468 100644 --- a/src/systemd/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/systemd/src/libsystemd-network/sd-dhcp-lease.c @@ -18,6 +18,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include <errno.h> #include <stdio.h> @@ -814,7 +816,7 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) { r = sd_dhcp_lease_get_client_id(lease, &client_id, &client_id_len); if (r >= 0) { - _cleanup_free_ char *client_id_hex; + _cleanup_free_ char *client_id_hex = NULL; client_id_hex = hexmem(client_id, client_id_len); if (!client_id_hex) { diff --git a/src/systemd/src/libsystemd-network/sd-dhcp6-client.c b/src/systemd/src/libsystemd-network/sd-dhcp6-client.c index b8fae1e805..64793fc68c 100644 --- a/src/systemd/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/systemd/src/libsystemd-network/sd-dhcp6-client.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <string.h> #include <sys/ioctl.h> diff --git a/src/systemd/src/libsystemd-network/sd-dhcp6-lease.c b/src/systemd/src/libsystemd-network/sd-dhcp6-lease.c index 3f32ba35e7..6a575aac98 100644 --- a/src/systemd/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/systemd/src/libsystemd-network/sd-dhcp6-lease.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include "alloc-util.h" diff --git a/src/systemd/src/libsystemd-network/sd-ipv4acd.c b/src/systemd/src/libsystemd-network/sd-ipv4acd.c index f7880a891c..99e663c19e 100644 --- a/src/systemd/src/libsystemd-network/sd-ipv4acd.c +++ b/src/systemd/src/libsystemd-network/sd-ipv4acd.c @@ -18,6 +18,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include <errno.h> #include <stdio.h> diff --git a/src/systemd/src/libsystemd-network/sd-ipv4ll.c b/src/systemd/src/libsystemd-network/sd-ipv4ll.c index db6cf22aaa..119d00fc98 100644 --- a/src/systemd/src/libsystemd-network/sd-ipv4ll.c +++ b/src/systemd/src/libsystemd-network/sd-ipv4ll.c @@ -18,6 +18,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include <errno.h> #include <stdio.h> diff --git a/src/systemd/src/libsystemd-network/sd-lldp.c b/src/systemd/src/libsystemd-network/sd-lldp.c index 1c696f9ef0..882f130a2e 100644 --- a/src/systemd/src/libsystemd-network/sd-lldp.c +++ b/src/systemd/src/libsystemd-network/sd-lldp.c @@ -20,6 +20,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <arpa/inet.h> #include "sd-lldp.h" diff --git a/src/systemd/src/libsystemd/sd-id128/sd-id128.c b/src/systemd/src/libsystemd/sd-id128/sd-id128.c index c12bb1e20b..bda3b735a1 100644 --- a/src/systemd/src/libsystemd/sd-id128/sd-id128.c +++ b/src/systemd/src/libsystemd/sd-id128/sd-id128.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <errno.h> #include <fcntl.h> #include <unistd.h> @@ -32,6 +34,7 @@ #include "random-util.h" #include "util.h" +#if 0 /* NM_IGNORED */ _public_ char *sd_id128_to_string(sd_id128_t id, char s[SD_ID128_STRING_MAX]) { unsigned n; @@ -107,6 +110,7 @@ static sd_id128_t make_v4_uuid(sd_id128_t id) { return id; } +#endif _public_ int sd_id128_get_machine(sd_id128_t *ret) { static thread_local sd_id128_t saved_machine_id; @@ -153,6 +157,7 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) { return 0; } +#if 0 /* NM_IGNORED */ _public_ int sd_id128_get_boot(sd_id128_t *ret) { static thread_local sd_id128_t saved_boot_id; static thread_local bool saved_boot_id_valid = false; @@ -225,3 +230,4 @@ _public_ int sd_id128_randomize(sd_id128_t *ret) { *ret = make_v4_uuid(t); return 0; } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/shared/dns-domain.c b/src/systemd/src/shared/dns-domain.c index 68404ca9e5..3a0d9e86d1 100644 --- a/src/systemd/src/shared/dns-domain.c +++ b/src/systemd/src/shared/dns-domain.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #ifdef HAVE_LIBIDN #include <idna.h> #include <stringprep.h> @@ -480,6 +482,7 @@ int dns_name_concat(const char *a, const char *b, char **_ret) { return 0; } +#if 0 /* NM_IGNORED */ void dns_name_hash_func(const void *s, struct siphash *state) { const char *p = s; int r; @@ -863,6 +866,7 @@ int dns_name_address(const char *p, int *family, union in_addr_union *address) { return 0; } +#endif /* NM_IGNORED */ bool dns_name_is_root(const char *name) { @@ -944,6 +948,7 @@ int dns_name_to_wire_format(const char *domain, uint8_t *buffer, size_t len, boo return out - buffer; } +#if 0 /* NM_IGNORED */ static bool srv_type_label_is_valid(const char *label, size_t n) { size_t k; @@ -1241,3 +1246,4 @@ int dns_name_equal_skip(const char *a, unsigned n_labels, const char *b) { return dns_name_equal(a, b); } +#endif /* NM_IGNORED */ diff --git a/src/systemd/src/shared/dns-domain.h b/src/systemd/src/shared/dns-domain.h index dd8ae3ac98..54860fb8f7 100644 --- a/src/systemd/src/shared/dns-domain.h +++ b/src/systemd/src/shared/dns-domain.h @@ -21,6 +21,7 @@ #pragma once +#include "nm-sd-adapt.h" #include <errno.h> #include <stdbool.h> diff --git a/src/systemd/src/systemd/_sd-common.h b/src/systemd/src/systemd/_sd-common.h index 6b5e6c50f9..5960a1c3c2 100644 --- a/src/systemd/src/systemd/_sd-common.h +++ b/src/systemd/src/systemd/_sd-common.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + /* This is a private header; never even think of including this directly! */ #if __INCLUDE_LEVEL__ <= 1 diff --git a/src/systemd/src/systemd/sd-dhcp-client.h b/src/systemd/src/systemd/sd-dhcp-client.h index 4deaf52e68..0fad8f3630 100644 --- a/src/systemd/src/systemd/sd-dhcp-client.h +++ b/src/systemd/src/systemd/sd-dhcp-client.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-dhcp-lease.h b/src/systemd/src/systemd/sd-dhcp-lease.h index cb5c2cf173..eed38eebd6 100644 --- a/src/systemd/src/systemd/sd-dhcp-lease.h +++ b/src/systemd/src/systemd/sd-dhcp-lease.h @@ -23,6 +23,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-dhcp6-client.h b/src/systemd/src/systemd/sd-dhcp6-client.h index 12cc763eb7..c18d91bf63 100644 --- a/src/systemd/src/systemd/sd-dhcp6-client.h +++ b/src/systemd/src/systemd/sd-dhcp6-client.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <net/ethernet.h> #include <sys/types.h> diff --git a/src/systemd/src/systemd/sd-dhcp6-lease.h b/src/systemd/src/systemd/sd-dhcp6-lease.h index 3a62d3402d..149cb23975 100644 --- a/src/systemd/src/systemd/sd-dhcp6-lease.h +++ b/src/systemd/src/systemd/sd-dhcp6-lease.h @@ -23,6 +23,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-event.h b/src/systemd/src/systemd/sd-event.h index 59cea09e59..17b95244f6 100644 --- a/src/systemd/src/systemd/sd-event.h +++ b/src/systemd/src/systemd/sd-event.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <signal.h> #include <sys/epoll.h> diff --git a/src/systemd/src/systemd/sd-id128.h b/src/systemd/src/systemd/sd-id128.h index 9f445278bb..da1bb2fa24 100644 --- a/src/systemd/src/systemd/sd-id128.h +++ b/src/systemd/src/systemd/sd-id128.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <string.h> diff --git a/src/systemd/src/systemd/sd-ipv4acd.h b/src/systemd/src/systemd/sd-ipv4acd.h index 9f0e2ba7d4..14d0e5a954 100644 --- a/src/systemd/src/systemd/sd-ipv4acd.h +++ b/src/systemd/src/systemd/sd-ipv4acd.h @@ -23,6 +23,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-ipv4ll.h b/src/systemd/src/systemd/sd-ipv4ll.h index 8c2533d1e6..307aa6f7b9 100644 --- a/src/systemd/src/systemd/sd-ipv4ll.h +++ b/src/systemd/src/systemd/sd-ipv4ll.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <net/ethernet.h> #include <netinet/in.h> diff --git a/src/systemd/src/systemd/sd-lldp.h b/src/systemd/src/systemd/sd-lldp.h index d912b08a6a..d4e7a4fad3 100644 --- a/src/systemd/src/systemd/sd-lldp.h +++ b/src/systemd/src/systemd/sd-lldp.h @@ -23,6 +23,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <net/ethernet.h> diff --git a/src/systemd/src/systemd/sd-ndisc.h b/src/systemd/src/systemd/sd-ndisc.h index d48612efdf..cc6743363c 100644 --- a/src/systemd/src/systemd/sd-ndisc.h +++ b/src/systemd/src/systemd/sd-ndisc.h @@ -22,6 +22,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "nm-sd-adapt.h" + #include <inttypes.h> #include <net/ethernet.h> |