0005-src-basic-missing.h-check-for-missing-strndupa.patch 17 KB

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