Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | From cef23a651ea200e30e1e6ed2a2564505e3a42d46 Mon Sep 17 00:00:00 2001 |
| 2 | From: Chen Qi <Qi.Chen@windriver.com> |
| 3 | Date: Mon, 25 Feb 2019 14:18:21 +0800 |
| 4 | Subject: [PATCH] src/basic/missing.h: check for missing strndupa |
| 5 | |
| 6 | include missing.h for definition of strndupa |
| 7 | |
| 8 | Upstream-Status: Inappropriate [musl specific] |
| 9 | |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 12 | [Rebased for v242] |
| 13 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> |
| 14 | [rebased for systemd 243] |
| 15 | Signed-off-by: Scott Murray <scott.murray@konsulko.com> |
| 16 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> |
| 17 | [rebased for systemd 244] |
| 18 | [Rebased for v247] |
| 19 | Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com> |
| 20 | |
| 21 | --- |
| 22 | meson.build | 1 + |
| 23 | src/backlight/backlight.c | 1 + |
| 24 | src/basic/cgroup-util.c | 1 + |
| 25 | src/basic/env-util.c | 1 + |
| 26 | src/basic/log.c | 1 + |
| 27 | src/basic/missing_stdlib.h | 12 ++++++++++++ |
| 28 | src/basic/mkdir.c | 1 + |
| 29 | src/basic/mountpoint-util.c | 1 + |
| 30 | src/basic/parse-util.c | 1 + |
| 31 | src/basic/path-lookup.c | 1 + |
| 32 | src/basic/percent-util.c | 1 + |
| 33 | src/basic/proc-cmdline.c | 1 + |
| 34 | src/basic/procfs-util.c | 1 + |
| 35 | src/basic/time-util.c | 1 + |
| 36 | src/boot/bless-boot.c | 1 + |
| 37 | src/core/dbus-cgroup.c | 1 + |
| 38 | src/core/dbus-execute.c | 1 + |
| 39 | src/core/dbus-util.c | 1 + |
| 40 | src/core/execute.c | 1 + |
| 41 | src/core/kmod-setup.c | 1 + |
| 42 | src/core/service.c | 1 + |
| 43 | src/coredump/coredump-vacuum.c | 1 + |
| 44 | src/journal-remote/journal-remote-main.c | 1 + |
| 45 | src/journal/journalctl.c | 1 + |
| 46 | src/libsystemd/sd-bus/bus-message.c | 1 + |
| 47 | src/libsystemd/sd-bus/bus-objects.c | 1 + |
| 48 | src/libsystemd/sd-bus/bus-socket.c | 1 + |
| 49 | src/libsystemd/sd-bus/sd-bus.c | 1 + |
| 50 | src/libsystemd/sd-bus/test-bus-benchmark.c | 1 + |
| 51 | src/libsystemd/sd-journal/sd-journal.c | 1 + |
| 52 | src/locale/keymap-util.c | 1 + |
| 53 | src/login/pam_systemd.c | 1 + |
| 54 | src/network/generator/network-generator.c | 1 + |
| 55 | src/nspawn/nspawn-settings.c | 1 + |
| 56 | src/nss-mymachines/nss-mymachines.c | 1 + |
| 57 | src/portable/portable.c | 1 + |
| 58 | src/resolve/resolvectl.c | 1 + |
| 59 | src/shared/bus-get-properties.c | 1 + |
| 60 | src/shared/bus-unit-procs.c | 1 + |
| 61 | src/shared/bus-unit-util.c | 1 + |
| 62 | src/shared/bus-util.c | 1 + |
| 63 | src/shared/dns-domain.c | 1 + |
| 64 | src/shared/journal-importer.c | 1 + |
| 65 | src/shared/logs-show.c | 1 + |
| 66 | src/shared/pager.c | 1 + |
| 67 | src/shared/uid-range.c | 1 + |
| 68 | src/socket-proxy/socket-proxyd.c | 1 + |
| 69 | src/test/test-hexdecoct.c | 1 + |
| 70 | src/udev/udev-builtin-path_id.c | 1 + |
| 71 | src/udev/udev-event.c | 1 + |
| 72 | src/udev/udev-rules.c | 1 + |
| 73 | 51 files changed, 62 insertions(+) |
| 74 | |
| 75 | --- a/meson.build |
| 76 | +++ b/meson.build |
| 77 | @@ -507,6 +507,7 @@ foreach ident : ['secure_getenv', '__sec |
| 78 | endforeach |
| 79 | |
| 80 | foreach ident : [ |
| 81 | + ['strndupa' , '''#include <string.h>'''], |
| 82 | ['memfd_create', '''#include <sys/mman.h>'''], |
| 83 | ['gettid', '''#include <sys/types.h> |
| 84 | #include <unistd.h>'''], |
| 85 | --- a/src/backlight/backlight.c |
| 86 | +++ b/src/backlight/backlight.c |
| 87 | @@ -19,6 +19,7 @@ |
| 88 | #include "string-util.h" |
| 89 | #include "strv.h" |
| 90 | #include "util.h" |
| 91 | +#include "missing_stdlib.h" |
| 92 | |
| 93 | static int help(void) { |
| 94 | _cleanup_free_ char *link = NULL; |
| 95 | --- a/src/basic/cgroup-util.c |
| 96 | +++ b/src/basic/cgroup-util.c |
| 97 | @@ -37,6 +37,7 @@ |
| 98 | #include "unit-name.h" |
| 99 | #include "user-util.h" |
| 100 | #include "xattr-util.h" |
| 101 | +#include "missing_stdlib.h" |
| 102 | |
| 103 | static int cg_enumerate_items(const char *controller, const char *path, FILE **_f, const char *item) { |
| 104 | _cleanup_free_ char *fs = NULL; |
| 105 | --- a/src/basic/env-util.c |
| 106 | +++ b/src/basic/env-util.c |
| 107 | @@ -19,6 +19,7 @@ |
| 108 | #include "string-util.h" |
| 109 | #include "strv.h" |
| 110 | #include "utf8.h" |
| 111 | +#include "missing_stdlib.h" |
| 112 | |
| 113 | /* We follow bash for the character set. Different shells have different rules. */ |
| 114 | #define VALID_BASH_ENV_NAME_CHARS \ |
| 115 | --- a/src/basic/log.c |
| 116 | +++ b/src/basic/log.c |
| 117 | @@ -36,6 +36,7 @@ |
| 118 | #include "terminal-util.h" |
| 119 | #include "time-util.h" |
| 120 | #include "utf8.h" |
| 121 | +#include "missing_stdlib.h" |
| 122 | |
| 123 | #define SNDBUF_SIZE (8*1024*1024) |
| 124 | |
| 125 | --- a/src/basic/missing_stdlib.h |
| 126 | +++ b/src/basic/missing_stdlib.h |
| 127 | @@ -11,3 +11,15 @@ |
| 128 | # error "neither secure_getenv nor __secure_getenv are available" |
| 129 | # endif |
| 130 | #endif |
| 131 | + |
| 132 | +/* string.h */ |
| 133 | +#if ! HAVE_STRNDUPA |
| 134 | +#define strndupa(s, n) \ |
| 135 | + ({ \ |
| 136 | + const char *__old = (s); \ |
| 137 | + size_t __len = strnlen(__old, (n)); \ |
| 138 | + char *__new = (char *)alloca(__len + 1); \ |
| 139 | + __new[__len] = '\0'; \ |
| 140 | + (char *)memcpy(__new, __old, __len); \ |
| 141 | + }) |
| 142 | +#endif |
| 143 | --- a/src/basic/mkdir.c |
| 144 | +++ b/src/basic/mkdir.c |
| 145 | @@ -15,6 +15,7 @@ |
| 146 | #include "stat-util.h" |
| 147 | #include "stdio-util.h" |
| 148 | #include "user-util.h" |
| 149 | +#include "missing_stdlib.h" |
| 150 | |
| 151 | int mkdir_safe_internal( |
| 152 | const char *path, |
| 153 | --- a/src/basic/mountpoint-util.c |
| 154 | +++ b/src/basic/mountpoint-util.c |
| 155 | @@ -13,6 +13,7 @@ |
| 156 | #include "missing_stat.h" |
| 157 | #include "missing_syscall.h" |
| 158 | #include "mkdir.h" |
| 159 | +#include "missing_stdlib.h" |
| 160 | #include "mountpoint-util.h" |
| 161 | #include "nulstr-util.h" |
| 162 | #include "parse-util.h" |
| 163 | --- a/src/basic/parse-util.c |
| 164 | +++ b/src/basic/parse-util.c |
| 165 | @@ -18,6 +18,7 @@ |
| 166 | #include "stat-util.h" |
| 167 | #include "string-util.h" |
| 168 | #include "strv.h" |
| 169 | +#include "missing_stdlib.h" |
| 170 | |
| 171 | int parse_boolean(const char *v) { |
| 172 | if (!v) |
| 173 | --- a/src/basic/path-lookup.c |
| 174 | +++ b/src/basic/path-lookup.c |
| 175 | @@ -16,6 +16,7 @@ |
| 176 | #include "strv.h" |
| 177 | #include "tmpfile-util.h" |
| 178 | #include "user-util.h" |
| 179 | +#include "missing_stdlib.h" |
| 180 | |
| 181 | int xdg_user_runtime_dir(char **ret, const char *suffix) { |
| 182 | const char *e; |
| 183 | --- a/src/basic/percent-util.c |
| 184 | +++ b/src/basic/percent-util.c |
| 185 | @@ -3,6 +3,7 @@ |
| 186 | #include "percent-util.h" |
| 187 | #include "string-util.h" |
| 188 | #include "parse-util.h" |
| 189 | +#include "missing_stdlib.h" |
| 190 | |
| 191 | static int parse_parts_value_whole(const char *p, const char *symbol) { |
| 192 | const char *pc, *n; |
| 193 | --- a/src/basic/proc-cmdline.c |
| 194 | +++ b/src/basic/proc-cmdline.c |
| 195 | @@ -15,6 +15,7 @@ |
| 196 | #include "string-util.h" |
| 197 | #include "util.h" |
| 198 | #include "virt.h" |
| 199 | +#include "missing_stdlib.h" |
| 200 | |
| 201 | int proc_cmdline(char **ret) { |
| 202 | const char *e; |
| 203 | --- a/src/basic/procfs-util.c |
| 204 | +++ b/src/basic/procfs-util.c |
| 205 | @@ -12,6 +12,7 @@ |
| 206 | #include "procfs-util.h" |
| 207 | #include "stdio-util.h" |
| 208 | #include "string-util.h" |
| 209 | +#include "missing_stdlib.h" |
| 210 | |
| 211 | int procfs_get_pid_max(uint64_t *ret) { |
| 212 | _cleanup_free_ char *value = NULL; |
| 213 | --- a/src/basic/time-util.c |
| 214 | +++ b/src/basic/time-util.c |
| 215 | @@ -26,6 +26,7 @@ |
| 216 | #include "string-util.h" |
| 217 | #include "strv.h" |
| 218 | #include "time-util.h" |
| 219 | +#include "missing_stdlib.h" |
| 220 | |
| 221 | static clockid_t map_clock_id(clockid_t c) { |
| 222 | |
| 223 | --- a/src/boot/bless-boot.c |
| 224 | +++ b/src/boot/bless-boot.c |
| 225 | @@ -19,6 +19,7 @@ |
| 226 | #include "util.h" |
| 227 | #include "verbs.h" |
| 228 | #include "virt.h" |
| 229 | +#include "missing_stdlib.h" |
| 230 | |
| 231 | static char **arg_path = NULL; |
| 232 | |
| 233 | --- a/src/core/dbus-execute.c |
| 234 | +++ b/src/core/dbus-execute.c |
| 235 | @@ -44,6 +44,7 @@ |
| 236 | #include "unit-printf.h" |
| 237 | #include "user-util.h" |
| 238 | #include "utf8.h" |
| 239 | +#include "missing_stdlib.h" |
| 240 | |
| 241 | BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput); |
| 242 | static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_input, exec_input, ExecInput); |
| 243 | --- a/src/core/dbus-util.c |
| 244 | +++ b/src/core/dbus-util.c |
| 245 | @@ -9,6 +9,7 @@ |
| 246 | #include "unit-printf.h" |
| 247 | #include "user-util.h" |
| 248 | #include "unit.h" |
| 249 | +#include "missing_stdlib.h" |
| 250 | |
| 251 | int bus_property_get_triggered_unit( |
| 252 | sd_bus *bus, |
| 253 | --- a/src/core/execute.c |
| 254 | +++ b/src/core/execute.c |
| 255 | @@ -102,6 +102,7 @@ |
| 256 | #include "unit-serialize.h" |
| 257 | #include "user-util.h" |
| 258 | #include "utmp-wtmp.h" |
| 259 | +#include "missing_stdlib.h" |
| 260 | |
| 261 | #define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC) |
| 262 | #define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC) |
| 263 | --- a/src/core/kmod-setup.c |
| 264 | +++ b/src/core/kmod-setup.c |
| 265 | @@ -11,6 +11,7 @@ |
| 266 | #include "recurse-dir.h" |
| 267 | #include "string-util.h" |
| 268 | #include "missing_type.h" |
| 269 | +#include "missing_stdlib.h" |
| 270 | |
| 271 | #if HAVE_KMOD |
| 272 | #include "module-util.h" |
| 273 | --- a/src/core/service.c |
| 274 | +++ b/src/core/service.c |
| 275 | @@ -42,6 +42,7 @@ |
| 276 | #include "unit.h" |
| 277 | #include "utf8.h" |
| 278 | #include "util.h" |
| 279 | +#include "missing_stdlib.h" |
| 280 | |
| 281 | static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = { |
| 282 | [SERVICE_DEAD] = UNIT_INACTIVE, |
| 283 | --- a/src/coredump/coredump-vacuum.c |
| 284 | +++ b/src/coredump/coredump-vacuum.c |
| 285 | @@ -16,6 +16,7 @@ |
| 286 | #include "string-util.h" |
| 287 | #include "time-util.h" |
| 288 | #include "user-util.h" |
| 289 | +#include "missing_stdlib.h" |
| 290 | |
| 291 | #define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL) /* 1 MiB */ |
| 292 | #define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL) /* 4 GiB */ |
| 293 | --- a/src/journal-remote/journal-remote-main.c |
| 294 | +++ b/src/journal-remote/journal-remote-main.c |
| 295 | @@ -24,6 +24,7 @@ |
| 296 | #include "stat-util.h" |
| 297 | #include "string-table.h" |
| 298 | #include "strv.h" |
| 299 | +#include "missing_stdlib.h" |
| 300 | |
| 301 | #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-remote.pem" |
| 302 | #define CERT_FILE CERTIFICATE_ROOT "/certs/journal-remote.pem" |
| 303 | --- a/src/journal/journalctl.c |
| 304 | +++ b/src/journal/journalctl.c |
| 305 | @@ -73,6 +73,7 @@ |
| 306 | #include "unit-name.h" |
| 307 | #include "user-util.h" |
| 308 | #include "varlink.h" |
| 309 | +#include "missing_stdlib.h" |
| 310 | |
| 311 | #define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE) |
| 312 | #define PROCESS_INOTIFY_INTERVAL 1024 /* Every 1,024 messages processed */ |
| 313 | --- a/src/libsystemd/sd-bus/bus-message.c |
| 314 | +++ b/src/libsystemd/sd-bus/bus-message.c |
| 315 | @@ -20,6 +20,7 @@ |
| 316 | #include "strv.h" |
| 317 | #include "time-util.h" |
| 318 | #include "utf8.h" |
| 319 | +#include "missing_stdlib.h" |
| 320 | |
| 321 | static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored); |
| 322 | |
| 323 | --- a/src/libsystemd/sd-bus/bus-objects.c |
| 324 | +++ b/src/libsystemd/sd-bus/bus-objects.c |
Andrew Geissler | 78b7279 | 2022-06-14 06:47:25 -0500 | [diff] [blame^] | 325 | @@ -11,6 +11,7 @@ |
| 326 | #include "missing_capability.h" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 327 | #include "string-util.h" |
| 328 | #include "strv.h" |
| 329 | +#include "missing_stdlib.h" |
| 330 | |
| 331 | static int node_vtable_get_userdata( |
| 332 | sd_bus *bus, |
| 333 | --- a/src/libsystemd/sd-bus/bus-socket.c |
| 334 | +++ b/src/libsystemd/sd-bus/bus-socket.c |
| 335 | @@ -28,6 +28,7 @@ |
| 336 | #include "string-util.h" |
| 337 | #include "user-util.h" |
| 338 | #include "utf8.h" |
| 339 | +#include "missing_stdlib.h" |
| 340 | |
| 341 | #define SNDBUF_SIZE (8*1024*1024) |
| 342 | |
| 343 | --- a/src/libsystemd/sd-bus/sd-bus.c |
| 344 | +++ b/src/libsystemd/sd-bus/sd-bus.c |
| 345 | @@ -43,6 +43,7 @@ |
| 346 | #include "string-util.h" |
| 347 | #include "strv.h" |
| 348 | #include "user-util.h" |
| 349 | +#include "missing_stdlib.h" |
| 350 | |
| 351 | #define log_debug_bus_message(m) \ |
| 352 | do { \ |
| 353 | --- a/src/libsystemd/sd-bus/test-bus-benchmark.c |
| 354 | +++ b/src/libsystemd/sd-bus/test-bus-benchmark.c |
| 355 | @@ -14,6 +14,7 @@ |
| 356 | #include "string-util.h" |
| 357 | #include "time-util.h" |
| 358 | #include "util.h" |
| 359 | +#include "missing_stdlib.h" |
| 360 | |
| 361 | #define MAX_SIZE (2*1024*1024) |
| 362 | |
| 363 | --- a/src/libsystemd/sd-journal/sd-journal.c |
| 364 | +++ b/src/libsystemd/sd-journal/sd-journal.c |
| 365 | @@ -41,6 +41,7 @@ |
| 366 | #include "string-util.h" |
| 367 | #include "strv.h" |
| 368 | #include "syslog-util.h" |
| 369 | +#include "missing_stdlib.h" |
| 370 | |
| 371 | #define JOURNAL_FILES_MAX 7168 |
| 372 | |
| 373 | --- a/src/locale/keymap-util.c |
| 374 | +++ b/src/locale/keymap-util.c |
| 375 | @@ -24,6 +24,7 @@ |
| 376 | #include "string-util.h" |
| 377 | #include "strv.h" |
| 378 | #include "tmpfile-util.h" |
| 379 | +#include "missing_stdlib.h" |
| 380 | |
| 381 | static bool startswith_comma(const char *s, const char *prefix) { |
| 382 | s = startswith(s, prefix); |
| 383 | --- a/src/login/pam_systemd.c |
| 384 | +++ b/src/login/pam_systemd.c |
| 385 | @@ -31,6 +31,7 @@ |
| 386 | #include "locale-util.h" |
| 387 | #include "login-util.h" |
| 388 | #include "macro.h" |
| 389 | +#include "missing_stdlib.h" |
| 390 | #include "pam-util.h" |
| 391 | #include "parse-util.h" |
| 392 | #include "path-util.h" |
| 393 | --- a/src/network/generator/network-generator.c |
| 394 | +++ b/src/network/generator/network-generator.c |
| 395 | @@ -13,6 +13,7 @@ |
| 396 | #include "string-table.h" |
| 397 | #include "string-util.h" |
| 398 | #include "strv.h" |
| 399 | +#include "missing_stdlib.h" |
| 400 | |
| 401 | /* |
| 402 | # .network |
| 403 | --- a/src/nspawn/nspawn-settings.c |
| 404 | +++ b/src/nspawn/nspawn-settings.c |
| 405 | @@ -17,6 +17,7 @@ |
| 406 | #include "strv.h" |
| 407 | #include "user-util.h" |
| 408 | #include "util.h" |
| 409 | +#include "missing_stdlib.h" |
| 410 | |
| 411 | Settings *settings_new(void) { |
| 412 | Settings *s; |
| 413 | --- a/src/nss-mymachines/nss-mymachines.c |
| 414 | +++ b/src/nss-mymachines/nss-mymachines.c |
| 415 | @@ -21,6 +21,7 @@ |
| 416 | #include "nss-util.h" |
| 417 | #include "signal-util.h" |
| 418 | #include "string-util.h" |
| 419 | +#include "missing_stdlib.h" |
| 420 | |
| 421 | static void setup_logging_once(void) { |
| 422 | static pthread_once_t once = PTHREAD_ONCE_INIT; |
| 423 | --- a/src/portable/portable.c |
| 424 | +++ b/src/portable/portable.c |
| 425 | @@ -39,6 +39,7 @@ |
| 426 | #include "strv.h" |
| 427 | #include "tmpfile-util.h" |
| 428 | #include "user-util.h" |
| 429 | +#include "missing_stdlib.h" |
| 430 | |
| 431 | /* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was |
| 432 | * dropped there by the portable service logic and b) for which image it was dropped there. */ |
| 433 | --- a/src/resolve/resolvectl.c |
| 434 | +++ b/src/resolve/resolvectl.c |
| 435 | @@ -43,6 +43,7 @@ |
| 436 | #include "utf8.h" |
| 437 | #include "verb-log-control.h" |
| 438 | #include "verbs.h" |
| 439 | +#include "missing_stdlib.h" |
| 440 | |
| 441 | static int arg_family = AF_UNSPEC; |
| 442 | static int arg_ifindex = 0; |
| 443 | --- a/src/shared/bus-get-properties.c |
| 444 | +++ b/src/shared/bus-get-properties.c |
| 445 | @@ -4,6 +4,7 @@ |
| 446 | #include "rlimit-util.h" |
| 447 | #include "stdio-util.h" |
| 448 | #include "string-util.h" |
| 449 | +#include "missing_stdlib.h" |
| 450 | |
| 451 | int bus_property_get_bool( |
| 452 | sd_bus *bus, |
| 453 | --- a/src/shared/bus-unit-procs.c |
| 454 | +++ b/src/shared/bus-unit-procs.c |
| 455 | @@ -10,6 +10,7 @@ |
| 456 | #include "sort-util.h" |
| 457 | #include "string-util.h" |
| 458 | #include "terminal-util.h" |
| 459 | +#include "missing_stdlib.h" |
| 460 | |
| 461 | struct CGroupInfo { |
| 462 | char *cgroup_path; |
| 463 | --- a/src/shared/bus-unit-util.c |
| 464 | +++ b/src/shared/bus-unit-util.c |
| 465 | @@ -49,6 +49,7 @@ |
| 466 | #include "unit-def.h" |
| 467 | #include "user-util.h" |
| 468 | #include "utf8.h" |
| 469 | +#include "missing_stdlib.h" |
| 470 | |
| 471 | int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) { |
| 472 | assert(message); |
| 473 | --- a/src/shared/bus-util.c |
| 474 | +++ b/src/shared/bus-util.c |
| 475 | @@ -21,6 +21,7 @@ |
| 476 | #include "path-util.h" |
| 477 | #include "socket-util.h" |
| 478 | #include "stdio-util.h" |
| 479 | +#include "missing_stdlib.h" |
| 480 | |
| 481 | static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) { |
| 482 | sd_event *e = userdata; |
| 483 | --- a/src/shared/dns-domain.c |
| 484 | +++ b/src/shared/dns-domain.c |
| 485 | @@ -17,6 +17,7 @@ |
| 486 | #include "string-util.h" |
| 487 | #include "strv.h" |
| 488 | #include "utf8.h" |
| 489 | +#include "missing_stdlib.h" |
| 490 | |
| 491 | int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags) { |
| 492 | const char *n; |
| 493 | --- a/src/shared/journal-importer.c |
| 494 | +++ b/src/shared/journal-importer.c |
| 495 | @@ -15,6 +15,7 @@ |
| 496 | #include "parse-util.h" |
| 497 | #include "string-util.h" |
| 498 | #include "unaligned.h" |
| 499 | +#include "missing_stdlib.h" |
| 500 | |
| 501 | enum { |
| 502 | IMPORTER_STATE_LINE = 0, /* waiting to read, or reading line */ |
| 503 | --- a/src/shared/logs-show.c |
| 504 | +++ b/src/shared/logs-show.c |
| 505 | @@ -42,6 +42,7 @@ |
| 506 | #include "utf8.h" |
| 507 | #include "util.h" |
| 508 | #include "web-util.h" |
| 509 | +#include "missing_stdlib.h" |
| 510 | |
| 511 | /* up to three lines (each up to 100 characters) or 300 characters, whichever is less */ |
| 512 | #define PRINT_LINE_THRESHOLD 3 |
| 513 | --- a/src/shared/pager.c |
| 514 | +++ b/src/shared/pager.c |
| 515 | @@ -26,6 +26,7 @@ |
| 516 | #include "strv.h" |
| 517 | #include "terminal-util.h" |
| 518 | #include "util.h" |
| 519 | +#include "missing_stdlib.h" |
| 520 | |
| 521 | static pid_t pager_pid = 0; |
| 522 | |
| 523 | --- a/src/shared/uid-range.c |
| 524 | +++ b/src/shared/uid-range.c |
| 525 | @@ -9,6 +9,7 @@ |
| 526 | #include "sort-util.h" |
| 527 | #include "uid-range.h" |
| 528 | #include "user-util.h" |
| 529 | +#include "missing_stdlib.h" |
| 530 | |
| 531 | static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) { |
| 532 | assert(range); |
| 533 | --- a/src/socket-proxy/socket-proxyd.c |
| 534 | +++ b/src/socket-proxy/socket-proxyd.c |
| 535 | @@ -26,6 +26,7 @@ |
| 536 | #include "socket-util.h" |
| 537 | #include "string-util.h" |
| 538 | #include "util.h" |
| 539 | +#include "missing_stdlib.h" |
| 540 | |
| 541 | #define BUFFER_SIZE (256 * 1024) |
| 542 | |
| 543 | --- a/src/test/test-hexdecoct.c |
| 544 | +++ b/src/test/test-hexdecoct.c |
| 545 | @@ -7,6 +7,7 @@ |
| 546 | #include "macro.h" |
| 547 | #include "random-util.h" |
| 548 | #include "string-util.h" |
| 549 | +#include "missing_stdlib.h" |
| 550 | #include "tests.h" |
| 551 | |
| 552 | TEST(hexchar) { |
| 553 | --- a/src/udev/udev-builtin-path_id.c |
| 554 | +++ b/src/udev/udev-builtin-path_id.c |
| 555 | @@ -22,6 +22,7 @@ |
| 556 | #include "sysexits.h" |
| 557 | #include "udev-builtin.h" |
| 558 | #include "udev-util.h" |
| 559 | +#include "missing_stdlib.h" |
| 560 | |
| 561 | _printf_(2,3) |
| 562 | static void path_prepend(char **path, const char *fmt, ...) { |
| 563 | --- a/src/udev/udev-event.c |
| 564 | +++ b/src/udev/udev-event.c |
| 565 | @@ -35,6 +35,7 @@ |
| 566 | #include "udev-util.h" |
| 567 | #include "udev-watch.h" |
| 568 | #include "user-util.h" |
| 569 | +#include "missing_stdlib.h" |
| 570 | |
| 571 | typedef struct Spawn { |
| 572 | sd_device *device; |
| 573 | --- a/src/udev/udev-rules.c |
| 574 | +++ b/src/udev/udev-rules.c |
| 575 | @@ -34,6 +34,7 @@ |
| 576 | #include "udev-util.h" |
| 577 | #include "user-util.h" |
| 578 | #include "virt.h" |
| 579 | +#include "missing_stdlib.h" |
| 580 | |
| 581 | #define RULES_DIRS (const char* const*) CONF_PATHS_STRV("udev/rules.d") |
| 582 | |
| 583 | --- a/src/core/dbus-cgroup.c |
| 584 | +++ b/src/core/dbus-cgroup.c |
| 585 | @@ -21,6 +21,7 @@ |
| 586 | #include "parse-util.h" |
| 587 | #include "path-util.h" |
| 588 | #include "percent-util.h" |
| 589 | +#include "missing_stdlib.h" |
| 590 | #include "socket-util.h" |
| 591 | |
| 592 | BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", TasksMax, tasks_max_resolve); |
| 593 | --- a/src/fstab-generator/fstab-generator.c |
| 594 | +++ b/src/fstab-generator/fstab-generator.c |
| 595 | @@ -29,6 +29,7 @@ |
| 596 | #include "util.h" |
| 597 | #include "virt.h" |
| 598 | #include "volatile-util.h" |
| 599 | +#include "missing_stdlib.h" |
| 600 | |
| 601 | typedef enum MountPointFlags { |
| 602 | MOUNT_NOAUTO = 1 << 0, |