~xdavidwu/systemd-apkbuilds

7df183940220b4bb6ced89a264cdb7b1d2f75804 — xdavidwu 2 years ago b451e03
systemd: 251.2, repull oe-core patches
M systemd/0001-Adjust-for-musl-headers.patch => systemd/0001-Adjust-for-musl-headers.patch +116 -15
@@ 1,4 1,4 @@
From 4c2e932664ec67662f4a0306cca4a7cd82853bda Mon Sep 17 00:00:00 2001
From 9a1841402ce3ef21a10a7314a07a615f8196d406 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 22:19:37 -0800
Subject: [PATCH] Adjust for musl headers


@@ 6,6 6,7 @@ Subject: [PATCH] Adjust for musl headers
Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 src/libsystemd-network/sd-dhcp6-client.c      | 2 +-
 src/network/netdev/bareudp.c                  | 2 +-


@@ 29,20 30,25 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 src/network/netdev/vrf.c                      | 2 +-
 src/network/netdev/vxcan.c                    | 2 +-
 src/network/netdev/vxlan.c                    | 2 +-
 src/network/netdev/wireguard.c                | 2 +-
 src/network/netdev/xfrm.c                     | 2 +-
 src/network/networkd-bridge-mdb.c             | 4 ++--
 src/network/networkd-dhcp-common.c            | 3 ++-
 src/network/networkd-dhcp-prefix-delegation.c | 4 ++--
 src/network/networkd-dhcp-server.c            | 2 +-
 src/network/networkd-dhcp4.c                  | 2 +-
 src/network/networkd-ipv6ll.c                 | 2 +-
 src/network/networkd-link.c                   | 2 +-
 src/network/networkd-ndisc.c                  | 2 +-
 src/network/networkd-route.c                  | 8 ++++----
 src/network/networkd-setlink.c                | 2 +-
 src/shared/linux/ethtool.h                    | 3 ++-
 src/shared/netif-util.c                       | 2 +-
 src/udev/udev-builtin-net_id.c                | 2 +-
 34 files changed, 41 insertions(+), 39 deletions(-)
 37 files changed, 44 insertions(+), 42 deletions(-)

diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index b346a50d78..7884d4c1cd 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -5,7 +5,7 @@


@@ 54,6 60,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_infiniband.h>
 
 #include "sd-dhcp6-client.h"
diff --git a/src/network/netdev/bareudp.c b/src/network/netdev/bareudp.c
index 8ff0eb1360..7e06b8d57d 100644
--- a/src/network/netdev/bareudp.c
+++ b/src/network/netdev/bareudp.c
@@ -2,7 +2,7 @@


@@ 65,6 73,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "bareudp.h"
 #include "netlink-util.h"
diff --git a/src/network/netdev/batadv.c b/src/network/netdev/batadv.c
index 15f3aee3a6..ec76428436 100644
--- a/src/network/netdev/batadv.c
+++ b/src/network/netdev/batadv.c
@@ -3,7 +3,7 @@


@@ 76,6 86,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "batadv.h"
 #include "fileio.h"
diff --git a/src/network/netdev/bond.c b/src/network/netdev/bond.c
index 5d94aa1d68..4e379a326d 100644
--- a/src/network/netdev/bond.c
+++ b/src/network/netdev/bond.c
@@ -1,7 +1,7 @@


@@ 87,6 99,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "alloc-util.h"
 #include "bond.h"
diff --git a/src/network/netdev/bridge.c b/src/network/netdev/bridge.c
index b974f2ae0a..9a5f18d556 100644
--- a/src/network/netdev/bridge.c
+++ b/src/network/netdev/bridge.c
@@ -2,7 +2,7 @@


@@ 98,6 112,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_bridge.h>
 
 #include "bridge.h"
diff --git a/src/network/netdev/dummy.c b/src/network/netdev/dummy.c
index 00df1d2787..77b506b422 100644
--- a/src/network/netdev/dummy.c
+++ b/src/network/netdev/dummy.c
@@ -1,6 +1,6 @@


@@ 108,6 124,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "dummy.h"
 
diff --git a/src/network/netdev/geneve.c b/src/network/netdev/geneve.c
index 224c17e979..fb79cc13f6 100644
--- a/src/network/netdev/geneve.c
+++ b/src/network/netdev/geneve.c
@@ -2,7 +2,7 @@


@@ 119,6 137,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "alloc-util.h"
 #include "conf-parser.h"
diff --git a/src/network/netdev/ifb.c b/src/network/netdev/ifb.c
index d7ff44cb9e..e037629ae4 100644
--- a/src/network/netdev/ifb.c
+++ b/src/network/netdev/ifb.c
@@ -1,7 +1,7 @@


@@ 130,6 150,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "ifb.h"
 
diff --git a/src/network/netdev/ipoib.c b/src/network/netdev/ipoib.c
index e0ff9e8c62..ab085c1f6d 100644
--- a/src/network/netdev/ipoib.c
+++ b/src/network/netdev/ipoib.c
@@ -1,6 +1,6 @@


@@ 140,6 162,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_link.h>
 
 #include "ipoib.h"
diff --git a/src/network/netdev/ipvlan.c b/src/network/netdev/ipvlan.c
index d15766cd7b..60728b4f94 100644
--- a/src/network/netdev/ipvlan.c
+++ b/src/network/netdev/ipvlan.c
@@ -2,7 +2,7 @@


@@ 151,6 175,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "conf-parser.h"
 #include "ipvlan.h"
diff --git a/src/network/netdev/macsec.c b/src/network/netdev/macsec.c
index f1a566a9ca..1f37927a83 100644
--- a/src/network/netdev/macsec.c
+++ b/src/network/netdev/macsec.c
@@ -1,7 +1,7 @@


@@ 162,6 188,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_ether.h>
 #include <linux/if_macsec.h>
 #include <linux/genetlink.h>
diff --git a/src/network/netdev/macvlan.c b/src/network/netdev/macvlan.c
index c41be6e78f..ee2660c5bf 100644
--- a/src/network/netdev/macvlan.c
+++ b/src/network/netdev/macvlan.c
@@ -2,7 +2,7 @@


@@ 173,6 201,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "conf-parser.h"
 #include "macvlan.h"
diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c
index 8e7fe11c18..701ab2bd69 100644
--- a/src/network/netdev/netdev.c
+++ b/src/network/netdev/netdev.c
@@ -2,7 +2,7 @@


@@ 184,6 214,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <unistd.h>
 
 #include "alloc-util.h"
diff --git a/src/network/netdev/netdevsim.c b/src/network/netdev/netdevsim.c
index 15d5c132f9..a3ffa48b15 100644
--- a/src/network/netdev/netdevsim.c
+++ b/src/network/netdev/netdevsim.c
@@ -1,6 +1,6 @@


@@ 194,6 226,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "netdevsim.h"
 
diff --git a/src/network/netdev/nlmon.c b/src/network/netdev/nlmon.c
index ff372092e6..eef66811f4 100644
--- a/src/network/netdev/nlmon.c
+++ b/src/network/netdev/nlmon.c
@@ -1,6 +1,6 @@


@@ 204,6 238,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "nlmon.h"
 
diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c
index 97e534fe99..0302c1cb94 100644
--- a/src/network/netdev/tunnel.c
+++ b/src/network/netdev/tunnel.c
@@ -2,7 +2,7 @@


@@ 215,6 251,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_tunnel.h>
 #include <linux/ip.h>
 #include <linux/ip6_tunnel.h>
diff --git a/src/network/netdev/vcan.c b/src/network/netdev/vcan.c
index 380547ee1e..137c1adf8a 100644
--- a/src/network/netdev/vcan.c
+++ b/src/network/netdev/vcan.c
@@ -1,6 +1,6 @@


@@ 225,6 263,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "vcan.h"
 
diff --git a/src/network/netdev/veth.c b/src/network/netdev/veth.c
index c946e81fc0..d1a6be73f9 100644
--- a/src/network/netdev/veth.c
+++ b/src/network/netdev/veth.c
@@ -3,7 +3,7 @@


@@ 236,6 276,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/veth.h>
 
 #include "netlink-util.h"
diff --git a/src/network/netdev/vlan.c b/src/network/netdev/vlan.c
index af3e77963e..efa4b0a164 100644
--- a/src/network/netdev/vlan.c
+++ b/src/network/netdev/vlan.c
@@ -2,7 +2,7 @@


@@ 247,6 289,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_vlan.h>
 
 #include "parse-util.h"
diff --git a/src/network/netdev/vrf.c b/src/network/netdev/vrf.c
index b1b6707441..1c6d1982e1 100644
--- a/src/network/netdev/vrf.c
+++ b/src/network/netdev/vrf.c
@@ -2,7 +2,7 @@


@@ 258,6 302,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "vrf.h"
 
diff --git a/src/network/netdev/vxcan.c b/src/network/netdev/vxcan.c
index a0ba048eb1..875f2e5901 100644
--- a/src/network/netdev/vxcan.c
+++ b/src/network/netdev/vxcan.c
@@ -1,7 +1,7 @@


@@ 269,6 315,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "vxcan.h"
 
diff --git a/src/network/netdev/vxlan.c b/src/network/netdev/vxlan.c
index 30b0855598..a065158801 100644
--- a/src/network/netdev/vxlan.c
+++ b/src/network/netdev/vxlan.c
@@ -2,7 +2,7 @@


@@ 280,6 328,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "conf-parser.h"
 #include "alloc-util.h"
diff --git a/src/network/netdev/wireguard.c b/src/network/netdev/wireguard.c
index 88f668753a..5fc753384b 100644
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -6,7 +6,7 @@
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/ipv6_route.h>
 
 #include "sd-resolve.h"
diff --git a/src/network/netdev/xfrm.c b/src/network/netdev/xfrm.c
index ef5e735b2b..419afd75f2 100644
--- a/src/network/netdev/xfrm.c
+++ b/src/network/netdev/xfrm.c
@@ -1,6 +1,6 @@


@@ 290,6 353,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "missing_network.h"
 #include "xfrm.h"
diff --git a/src/network/networkd-bridge-mdb.c b/src/network/networkd-bridge-mdb.c
index 10025a97ae..a0239ea83a 100644
--- a/src/network/networkd-bridge-mdb.c
+++ b/src/network/networkd-bridge-mdb.c
@@ -1,7 +1,5 @@


@@ 309,6 374,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #define STATIC_BRIDGE_MDB_ENTRIES_PER_NETWORK_MAX 1024U
 
diff --git a/src/network/networkd-dhcp-common.c b/src/network/networkd-dhcp-common.c
index 7996960bd1..e870b9ba26 100644
--- a/src/network/networkd-dhcp-common.c
+++ b/src/network/networkd-dhcp-common.c
@@ -1,7 +1,8 @@


@@ 321,6 388,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "bus-error.h"
 #include "dhcp-identifier.h"
diff --git a/src/network/networkd-dhcp-prefix-delegation.c b/src/network/networkd-dhcp-prefix-delegation.c
index 7be9713d46..e830fcd575 100644
--- a/src/network/networkd-dhcp-prefix-delegation.c
+++ b/src/network/networkd-dhcp-prefix-delegation.c
@@ -1,7 +1,5 @@


@@ 340,6 409,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 bool link_dhcp_pd_is_enabled(Link *link) {
         assert(link);
 
diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c
index 9acfd17d49..3108289602 100644
--- a/src/network/networkd-dhcp-server.c
+++ b/src/network/networkd-dhcp-server.c
@@ -1,7 +1,7 @@


@@ 351,6 422,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if.h>
 
 #include "sd-dhcp-server.h"
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index cb9c428ae9..a35d58f3f1 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -3,7 +3,7 @@


@@ 362,6 435,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #include "alloc-util.h"
 #include "dhcp-client-internal.h"
diff --git a/src/network/networkd-ipv6ll.c b/src/network/networkd-ipv6ll.c
index dc09171afe..5b93ef3dd4 100644
--- a/src/network/networkd-ipv6ll.c
+++ b/src/network/networkd-ipv6ll.c
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */

 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>

 #include "in-addr-util.h"
 #include "networkd-address.h"
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 63679505f7..825ea76ff2 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -3,7 +3,7 @@


@@ 373,6 461,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_link.h>
 #include <linux/netdevice.h>
 #include <sys/socket.h>
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index efe407fedb..46a086cdf5 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -6,7 +6,7 @@
 #include <arpa/inet.h>
 #include <netinet/icmp6.h>
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>

 #include "sd-ndisc.h"

diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index 934fed3b7f..fdb89313dd 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -1,9 +1,5 @@


@@ 396,6 499,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 int route_new(Route **ret) {
         _cleanup_(route_freep) Route *route = NULL;
 
diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c
index e00cc1e589..e392c7e1a2 100644
--- a/src/network/networkd-setlink.c
+++ b/src/network/networkd-setlink.c
@@ -2,7 +2,7 @@


@@ 407,11 512,13 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/if_bridge.h>
 
 #include "missing_network.h"
diff --git a/src/shared/linux/ethtool.h b/src/shared/linux/ethtool.h
index cf20b6dba5..c3a46dda11 100644
--- a/src/shared/linux/ethtool.h
+++ b/src/shared/linux/ethtool.h
@@ -16,7 +16,8 @@
 
 #include <linux/kernel.h>
 #include <linux/const.h>
 #include <linux/types.h>
-#include <linux/if_ether.h>
+#include <netinet/if_ether.h>


@@ 419,16 526,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 #ifndef __KERNEL__
 #include <limits.h> /* for INT_MAX */
diff --git a/src/shared/netif-util.c b/src/shared/netif-util.c
index f56c5646c1..5af28ff119 100644
--- a/src/shared/netif-util.c
+++ b/src/shared/netif-util.c
@@ -1,6 +1,6 @@
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/if.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 
 #include "arphrd-util.h"
 #include "device-util.h"
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index f2ea2a7cd5..fe60a0744d 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -18,7 +18,7 @@


@@ 440,14 552,3 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 #include <linux/netdevice.h>
 #include <linux/pci_regs.h>
 
--- a/src/network/netdev/wireguard.c
+++ b/src/network/netdev/wireguard.c
@@ -6,7 +6,7 @@
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <linux/if_arp.h>
+//#include <linux/if_arp.h>
 #include <linux/ipv6_route.h>
 
 #include "sd-resolve.h"

M systemd/0001-pass-correct-parameters-to-getdents64.patch => systemd/0001-pass-correct-parameters-to-getdents64.patch +8 -23
@@ 1,7 1,7 @@
From fbc10748c7c59d82024a4d35146b8dfef8d52927 Mon Sep 17 00:00:00 2001
From dab02796780f00d689cc1c7a0ba81abe7c5f28d0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 15:15:11 -0800
Subject: [PATCH 1/2] pass correct parameters to getdents64
Subject: [PATCH] pass correct parameters to getdents64

Fixes
../git/src/basic/recurse-dir.c:57:40: error: incompatible pointer types passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'struct dirent *' [-Werror,-Wincompatible-pointer-types]


@@ 12,15 12,16 @@ Fixes
        n = getdents64(fd, &buffer, sizeof(buffer));
                           ^~~~~~~

Upstream-Status: Pending
Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>

---
 src/basic/recurse-dir.c | 2 +-
 src/basic/stat-util.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/basic/recurse-dir.c b/src/basic/recurse-dir.c
index efa1797b7b..797285e3be 100644
index efa1797b7b..03ff10ebe9 100644
--- a/src/basic/recurse-dir.c
+++ b/src/basic/recurse-dir.c
@@ -54,7 +54,7 @@ int readdir_all(int dir_fd,


@@ 28,23 29,7 @@ index efa1797b7b..797285e3be 100644
                 assert(bs > de->buffer_size);
 
-                n = getdents64(dir_fd, (uint8_t*) de->buffer + de->buffer_size, bs - de->buffer_size);
+                n = getdents64(dir_fd, de->buffer + de->buffer_size, bs - de->buffer_size);
+                n = getdents64(dir_fd, (struct dirent*)((uint8_t*) de->buffer + de->buffer_size), bs - de->buffer_size);
                 if (n < 0)
                         return -errno;
                 if (n == 0)
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
index efac7b002e..9e1fe7f5a0 100644
--- a/src/basic/stat-util.c
+++ b/src/basic/stat-util.c
@@ -99,7 +99,7 @@ int dir_is_empty_at(int dir_fd, const char *path) {
                         return fd;
         }
 
-        n = getdents64(fd, &buffer, sizeof(buffer));
+        n = getdents64(fd, (struct dirent *)&buffer, sizeof(buffer));
         if (n < 0)
                 return -errno;
 
-- 
2.34.1


M systemd/0002-Add-sys-stat.h-for-S_IFDIR.patch => systemd/0002-Add-sys-stat.h-for-S_IFDIR.patch +6 -8
@@ 1,22 1,23 @@
From d16f7b37c917b91e951b9313e2c8264c72ed93e5 Mon Sep 17 00:00:00 2001
From 4b731a5e2547b5292f9a774b849e14c0cf7b3955 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 21 Jan 2022 15:17:37 -0800
Subject: [PATCH 2/2] Add sys/stat.h for S_IFDIR
Subject: [PATCH] Add sys/stat.h for S_IFDIR

../git/src/shared/mkdir-label.c:13:61: error: use of undeclared identifier 'S_IFDIR'
        r = mac_selinux_create_file_prepare_at(dirfd, path, S_IFDIR);

Upstream-Status: Pending
Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/23441]
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 src/shared/mkdir-label.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c
index d36a6466d7..63b764cd83 100644
index 5b1ac5d1e0..fa5802b894 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -4,6 +4,7 @@
@@ -6,6 +6,7 @@
 #include "selinux-util.h"
 #include "smack-util.h"
 #include "user-util.h"


@@ 24,6 25,3 @@ index d36a6466d7..63b764cd83 100644
 
 int mkdirat_label(int dirfd, const char *path, mode_t mode) {
         int r;
-- 
2.34.1


M systemd/0004-add-fallback-parse_printf_format-implementation.patch => systemd/0004-add-fallback-parse_printf_format-implementation.patch +18 -4
@@ 1,4 1,4 @@
From 3e0df2c22bfd37bc62bf09a01ec498e40d3599de Mon Sep 17 00:00:00 2001
From 3d9910dcda697b1e361bba49c99050ee0d116742 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Sat, 22 May 2021 20:26:24 +0200
Subject: [PATCH] add fallback parse_printf_format implementation


@@ 22,9 22,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 create mode 100644 src/basic/parse-printf-format.c
 create mode 100644 src/basic/parse-printf-format.h

diff --git a/meson.build b/meson.build
index 36cbfa4893..30b5305b89 100644
--- a/meson.build
+++ b/meson.build
@@ -686,6 +686,7 @@ endif
@@ -694,6 +694,7 @@ endif
 foreach header : ['crypt.h',
                   'linux/memfd.h',
                   'linux/vm_sockets.h',


@@ 32,9 34,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                   'sys/auxv.h',
                   'valgrind/memcheck.h',
                   'valgrind/valgrind.h',
diff --git a/src/basic/meson.build b/src/basic/meson.build
index 9b89fdcdea..0b1ef91016 100644
--- a/src/basic/meson.build
+++ b/src/basic/meson.build
@@ -335,6 +335,11 @@ endforeach
@@ -336,6 +336,11 @@ endforeach
 
 basic_sources += generated_gperf_headers
 


@@ 46,6 50,9 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 ############################################################
 
 arch_list = [
diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
new file mode 100644
index 0000000000..49437e5445
--- /dev/null
+++ b/src/basic/parse-printf-format.c
@@ -0,0 +1,273 @@


@@ 322,6 329,9 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+        return last;
+}
diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
new file mode 100644
index 0000000000..47be7522d7
--- /dev/null
+++ b/src/basic/parse-printf-format.h
@@ -0,0 +1,57 @@


@@ 382,6 392,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+size_t parse_printf_format(const char *fmt, size_t n, int *types);
+
+#endif /* HAVE_PRINTF_H */
diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
index 69d7062ec6..f55c5aab2c 100644
--- a/src/basic/stdio-util.h
+++ b/src/basic/stdio-util.h
@@ -1,13 +1,13 @@


@@ 399,6 411,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 
 #define snprintf_ok(buf, len, fmt, ...)                                \
         ({                                                             \
diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c
index 1e10ed5524..e6ceba54f9 100644
--- a/src/libsystemd/sd-journal/journal-send.c
+++ b/src/libsystemd/sd-journal/journal-send.c
@@ -2,7 +2,6 @@


@@ 409,7 423,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 #include <stddef.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -21,6 +20,7 @@
@@ -25,6 +24,7 @@
 #include "stdio-util.h"
 #include "string-util.h"
 #include "tmpfile-util.h"

M systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch => systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch +141 -37
@@ 1,4 1,4 @@
From cef23a651ea200e30e1e6ed2a2564505e3a42d46 Mon Sep 17 00:00:00 2001
From 106b7bd7186c9d6c1dcd72bd4ca6457d3fa72d0b Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 14:18:21 +0800
Subject: [PATCH] src/basic/missing.h: check for missing strndupa


@@ 17,7 17,6 @@ Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
[rebased for systemd 244]
[Rebased for v247]
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>

---
 meson.build                                |  1 +
 src/backlight/backlight.c                  |  1 +


@@ 41,6 40,7 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 src/core/kmod-setup.c                      |  1 +
 src/core/service.c                         |  1 +
 src/coredump/coredump-vacuum.c             |  1 +
 src/fstab-generator/fstab-generator.c      |  1 +
 src/journal-remote/journal-remote-main.c   |  1 +
 src/journal/journalctl.c                   |  1 +
 src/libsystemd/sd-bus/bus-message.c        |  1 +


@@ 70,11 70,13 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 src/udev/udev-builtin-path_id.c            |  1 +
 src/udev/udev-event.c                      |  1 +
 src/udev/udev-rules.c                      |  1 +
 51 files changed, 62 insertions(+)
 52 files changed, 63 insertions(+)

diff --git a/meson.build b/meson.build
index 30b5305b89..0189ef8ce6 100644
--- a/meson.build
+++ b/meson.build
@@ -507,6 +507,7 @@ foreach ident : ['secure_getenv', '__sec
@@ -512,6 +512,7 @@ foreach ident : ['secure_getenv', '__secure_getenv']
 endforeach
 
 foreach ident : [


@@ 82,16 84,20 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
         ['memfd_create',      '''#include <sys/mman.h>'''],
         ['gettid',            '''#include <sys/types.h>
                                  #include <unistd.h>'''],
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index a4e5d77f6c..fc12da4c53 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -19,6 +19,7 @@
 #include "string-util.h"
@@ -20,6 +20,7 @@
 #include "strv.h"
 #include "terminal-util.h"
 #include "util.h"
+#include "missing_stdlib.h"
 
 static int help(void) {
         _cleanup_free_ char *link = NULL;
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index b03cc70e2e..f4615ffce1 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -37,6 +37,7 @@


@@ 102,6 108,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static int cg_enumerate_items(const char *controller, const char *path, FILE **_f, const char *item) {
         _cleanup_free_ char *fs = NULL;
diff --git a/src/basic/env-util.c b/src/basic/env-util.c
index 885967e7f3..d0b7dc845e 100644
--- a/src/basic/env-util.c
+++ b/src/basic/env-util.c
@@ -19,6 +19,7 @@


@@ 112,6 120,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 /* We follow bash for the character set. Different shells have different rules. */
 #define VALID_BASH_ENV_NAME_CHARS               \
diff --git a/src/basic/log.c b/src/basic/log.c
index 12071e2ebd..15254c7bbc 100644
--- a/src/basic/log.c
+++ b/src/basic/log.c
@@ -36,6 +36,7 @@


@@ 122,6 132,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define SNDBUF_SIZE (8*1024*1024)
 
diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h
index 8c76f93eb2..9068bfb4f0 100644
--- a/src/basic/missing_stdlib.h
+++ b/src/basic/missing_stdlib.h
@@ -11,3 +11,15 @@


@@ 140,6 152,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
+    (char *)memcpy(__new, __old, __len); \
+  })
+#endif
diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
index 51a0d74e87..03569f71f8 100644
--- a/src/basic/mkdir.c
+++ b/src/basic/mkdir.c
@@ -15,6 +15,7 @@


@@ 150,6 164,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int mkdir_safe_internal(
                 const char *path,
diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
index 82a33a6829..d947774b40 100644
--- a/src/basic/mountpoint-util.c
+++ b/src/basic/mountpoint-util.c
@@ -13,6 +13,7 @@


@@ 160,6 176,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 #include "mountpoint-util.h"
 #include "nulstr-util.h"
 #include "parse-util.h"
diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
index 2888ab6523..d941afec2d 100644
--- a/src/basic/parse-util.c
+++ b/src/basic/parse-util.c
@@ -18,6 +18,7 @@


@@ 170,6 188,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int parse_boolean(const char *v) {
         if (!v)
diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c
index 6fb8c40e7a..c4b59e8518 100644
--- a/src/basic/path-lookup.c
+++ b/src/basic/path-lookup.c
@@ -16,6 +16,7 @@


@@ 180,6 200,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int xdg_user_runtime_dir(char **ret, const char *suffix) {
         const char *e;
diff --git a/src/basic/percent-util.c b/src/basic/percent-util.c
index cab9d0eaea..5f6ca258e9 100644
--- a/src/basic/percent-util.c
+++ b/src/basic/percent-util.c
@@ -3,6 +3,7 @@


@@ 190,6 212,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static int parse_parts_value_whole(const char *p, const char *symbol) {
         const char *pc, *n;
diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c
index 410b8a3eb5..f2c4355609 100644
--- a/src/basic/proc-cmdline.c
+++ b/src/basic/proc-cmdline.c
@@ -15,6 +15,7 @@


@@ 200,6 224,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int proc_cmdline(char **ret) {
         const char *e;
diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
index 65f96abb06..e485a0196b 100644
--- a/src/basic/procfs-util.c
+++ b/src/basic/procfs-util.c
@@ -12,6 +12,7 @@


@@ 210,6 236,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int procfs_get_pid_max(uint64_t *ret) {
         _cleanup_free_ char *value = NULL;
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index b659d6905d..020112be24 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -26,6 +26,7 @@


@@ 220,9 248,11 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static clockid_t map_clock_id(clockid_t c) {
 
diff --git a/src/boot/bless-boot.c b/src/boot/bless-boot.c
index d9c901d73b..79a035274c 100644
--- a/src/boot/bless-boot.c
+++ b/src/boot/bless-boot.c
@@ -19,6 +19,7 @@
@@ -22,6 +22,7 @@
 #include "util.h"
 #include "verbs.h"
 #include "virt.h"


@@ 230,6 260,20 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static char **arg_path = NULL;
 
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
index f0d8759e85..b4c1053e64 100644
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -21,6 +21,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "percent-util.h"
+#include "missing_stdlib.h"
 #include "socket-util.h"
 
 BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", TasksMax, tasks_max_resolve);
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index 5c499e5d06..e7ab1bb9a5 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -44,6 +44,7 @@


@@ 240,6 284,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_exec_output, exec_output, ExecOutput);
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_input, exec_input, ExecInput);
diff --git a/src/core/dbus-util.c b/src/core/dbus-util.c
index 32a2ec0ff9..36be2511e4 100644
--- a/src/core/dbus-util.c
+++ b/src/core/dbus-util.c
@@ -9,6 +9,7 @@


@@ 250,9 296,11 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int bus_property_get_triggered_unit(
                 sd_bus *bus,
diff --git a/src/core/execute.c b/src/core/execute.c
index 2762b10287..a8aeec7f6e 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -102,6 +102,7 @@
@@ -103,6 +103,7 @@
 #include "unit-serialize.h"
 #include "user-util.h"
 #include "utmp-wtmp.h"


@@ 260,16 308,20 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define IDLE_TIMEOUT_USEC (5*USEC_PER_SEC)
 #define IDLE_TIMEOUT2_USEC (1*USEC_PER_SEC)
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index f4488dd692..1d331a7ee2 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -11,6 +11,7 @@
 #include "macro.h"
 #include "recurse-dir.h"
 #include "string-util.h"
 #include "virt.h"
+#include "missing_stdlib.h"
 
 #if HAVE_KMOD
 #include "module-util.h"
diff --git a/src/core/service.c b/src/core/service.c
index 9f7af9dffb..3ec5e30c8b 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -42,6 +42,7 @@


@@ 278,11 330,13 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 #include "util.h"
+#include "missing_stdlib.h"
 
 static const UnitActiveState state_translation_table[_SERVICE_STATE_MAX] = {
         [SERVICE_DEAD] = UNIT_INACTIVE,
 #define service_spawn(...) service_spawn_internal(__func__, __VA_ARGS__)

diff --git a/src/coredump/coredump-vacuum.c b/src/coredump/coredump-vacuum.c
index c6e201ecf2..ab034475e2 100644
--- a/src/coredump/coredump-vacuum.c
+++ b/src/coredump/coredump-vacuum.c
@@ -16,6 +16,7 @@
@@ -17,6 +17,7 @@
 #include "string-util.h"
 #include "time-util.h"
 #include "user-util.h"


@@ 290,6 344,20 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define DEFAULT_MAX_USE_LOWER (uint64_t) (1ULL*1024ULL*1024ULL)           /* 1 MiB */
 #define DEFAULT_MAX_USE_UPPER (uint64_t) (4ULL*1024ULL*1024ULL*1024ULL)   /* 4 GiB */
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 9b32383a76..f8d3397a06 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -29,6 +29,7 @@
 #include "util.h"
 #include "virt.h"
 #include "volatile-util.h"
+#include "missing_stdlib.h"
 
 typedef enum MountPointFlags {
         MOUNT_NOAUTO    = 1 << 0,
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
index 3e3646e45f..6a8fc60f6d 100644
--- a/src/journal-remote/journal-remote-main.c
+++ b/src/journal-remote/journal-remote-main.c
@@ -24,6 +24,7 @@


@@ 300,9 368,11 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-remote.pem"
 #define CERT_FILE     CERTIFICATE_ROOT "/certs/journal-remote.pem"
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index cff34fd585..a5003e47e9 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -73,6 +73,7 @@
@@ -74,6 +74,7 @@
 #include "unit-name.h"
 #include "user-util.h"
 #include "varlink.h"


@@ 310,6 380,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
 #define PROCESS_INOTIFY_INTERVAL 1024   /* Every 1,024 messages processed */
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 96529b422b..ddb5e9c698 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -20,6 +20,7 @@


@@ 320,16 392,20 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
 
diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 909dfe4d3a..254b7ce866 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -12,6 +12,7 @@
 #include "set.h"
@@ -11,6 +11,7 @@
 #include "missing_capability.h"
 #include "string-util.h"
 #include "strv.h"
+#include "missing_stdlib.h"
 
 static int node_vtable_get_userdata(
                 sd_bus *bus,
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index 14951ccb33..b7f86ca501 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -28,6 +28,7 @@


@@ 340,6 416,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define SNDBUF_SIZE (8*1024*1024)
 
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 9e1d29cc1d..8c3165f0ce 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -43,6 +43,7 @@


@@ 350,6 428,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define log_debug_bus_message(m)                                         \
         do {                                                             \
diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c
index 317653bedc..d028216c48 100644
--- a/src/libsystemd/sd-bus/test-bus-benchmark.c
+++ b/src/libsystemd/sd-bus/test-bus-benchmark.c
@@ -14,6 +14,7 @@


@@ 360,6 440,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define MAX_SIZE (2*1024*1024)
 
diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c
index 7a6cc4aca3..b7f7cd65c5 100644
--- a/src/libsystemd/sd-journal/sd-journal.c
+++ b/src/libsystemd/sd-journal/sd-journal.c
@@ -41,6 +41,7 @@


@@ 370,6 452,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define JOURNAL_FILES_MAX 7168
 
diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
index 10d2ed7aec..4fbe3f6b4a 100644
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -24,6 +24,7 @@


@@ 380,6 464,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static bool startswith_comma(const char *s, const char *prefix) {
         s = startswith(s, prefix);
diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c
index 5bd7efc3e8..282899601e 100644
--- a/src/login/pam_systemd.c
+++ b/src/login/pam_systemd.c
@@ -31,6 +31,7 @@


@@ 390,6 476,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 #include "pam-util.h"
 #include "parse-util.h"
 #include "path-util.h"
diff --git a/src/network/generator/network-generator.c b/src/network/generator/network-generator.c
index 063ad08d80..f9823a433b 100644
--- a/src/network/generator/network-generator.c
+++ b/src/network/generator/network-generator.c
@@ -13,6 +13,7 @@


@@ 400,6 488,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 /*
   # .network
diff --git a/src/nspawn/nspawn-settings.c b/src/nspawn/nspawn-settings.c
index 1f58bf3ed4..8457a3b0e3 100644
--- a/src/nspawn/nspawn-settings.c
+++ b/src/nspawn/nspawn-settings.c
@@ -17,6 +17,7 @@


@@ 410,6 500,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 Settings *settings_new(void) {
         Settings *s;
diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c
index c64e79bdff..eda26b0b9a 100644
--- a/src/nss-mymachines/nss-mymachines.c
+++ b/src/nss-mymachines/nss-mymachines.c
@@ -21,6 +21,7 @@


@@ 420,6 512,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static void setup_logging_once(void) {
         static pthread_once_t once = PTHREAD_ONCE_INIT;
diff --git a/src/portable/portable.c b/src/portable/portable.c
index 0e6461ba93..54148d5924 100644
--- a/src/portable/portable.c
+++ b/src/portable/portable.c
@@ -39,6 +39,7 @@


@@ 430,6 524,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 /* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was
  * dropped there by the portable service logic and b) for which image it was dropped there. */
diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
index 5b3ceeff36..d36d1d57ae 100644
--- a/src/resolve/resolvectl.c
+++ b/src/resolve/resolvectl.c
@@ -43,6 +43,7 @@


@@ 440,6 536,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static int arg_family = AF_UNSPEC;
 static int arg_ifindex = 0;
diff --git a/src/shared/bus-get-properties.c b/src/shared/bus-get-properties.c
index 8b4f66b22e..5926e4c61b 100644
--- a/src/shared/bus-get-properties.c
+++ b/src/shared/bus-get-properties.c
@@ -4,6 +4,7 @@


@@ 450,6 548,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int bus_property_get_bool(
                 sd_bus *bus,
diff --git a/src/shared/bus-unit-procs.c b/src/shared/bus-unit-procs.c
index 87c0334fec..402ab3493b 100644
--- a/src/shared/bus-unit-procs.c
+++ b/src/shared/bus-unit-procs.c
@@ -10,6 +10,7 @@


@@ 460,6 560,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 struct CGroupInfo {
         char *cgroup_path;
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index dcce530c99..faf5a5bda0 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -49,6 +49,7 @@


@@ 470,6 572,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
         assert(message);
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 4a2b7684bc..ee6d687c58 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -21,6 +21,7 @@


@@ 480,6 584,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
         sd_event *e = userdata;
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index f54b187a1b..299758c7e4 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -17,6 +17,7 @@


@@ 490,6 596,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags) {
         const char *n;
diff --git a/src/shared/journal-importer.c b/src/shared/journal-importer.c
index c6caf9330a..ebe33bd44a 100644
--- a/src/shared/journal-importer.c
+++ b/src/shared/journal-importer.c
@@ -15,6 +15,7 @@


@@ 500,6 608,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 enum {
         IMPORTER_STATE_LINE = 0,    /* waiting to read, or reading line */
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index cf83eb6bca..e672a003a3 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -42,6 +42,7 @@


@@ 510,6 620,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 /* up to three lines (each up to 100 characters) or 300 characters, whichever is less */
 #define PRINT_LINE_THRESHOLD 3
diff --git a/src/shared/pager.c b/src/shared/pager.c
index f75ef62d2d..530001a821 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -26,6 +26,7 @@


@@ 520,16 632,20 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 static pid_t pager_pid = 0;
 
diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
index 1b4396a34c..c2f72b185f 100644
--- a/src/shared/uid-range.c
+++ b/src/shared/uid-range.c
@@ -9,6 +9,7 @@
 #include "sort-util.h"
@@ -14,6 +14,7 @@
 #include "stat-util.h"
 #include "uid-range.h"
 #include "user-util.h"
+#include "missing_stdlib.h"
 
 static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
         assert(range);
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index 7e9ab19666..56f619e54e 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -26,6 +26,7 @@


@@ 540,6 656,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define BUFFER_SIZE (256 * 1024)
 
diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
index cc9a7cb838..a679614a47 100644
--- a/src/test/test-hexdecoct.c
+++ b/src/test/test-hexdecoct.c
@@ -7,6 +7,7 @@


@@ 550,6 668,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 #include "tests.h"
 
 TEST(hexchar) {
diff --git a/src/udev/udev-builtin-path_id.c b/src/udev/udev-builtin-path_id.c
index ae92e45205..1e6f3205cb 100644
--- a/src/udev/udev-builtin-path_id.c
+++ b/src/udev/udev-builtin-path_id.c
@@ -22,6 +22,7 @@


@@ 560,6 680,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 _printf_(2,3)
 static void path_prepend(char **path, const char *fmt, ...) {
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index a60e4f294c..571c43765b 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -35,6 +35,7 @@


@@ 570,6 692,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 typedef struct Spawn {
         sd_device *device;
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 1a384d6b38..0089833e3f 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -34,6 +34,7 @@


@@ 580,23 704,3 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
 #define RULES_DIRS (const char* const*) CONF_PATHS_STRV("udev/rules.d")
 
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -21,6 +21,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "percent-util.h"
+#include "missing_stdlib.h"
 #include "socket-util.h"
 
 BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", TasksMax, tasks_max_resolve);
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -29,6 +29,7 @@
 #include "util.h"
 #include "virt.h"
 #include "volatile-util.h"
+#include "missing_stdlib.h"
 
 typedef enum MountPointFlags {
         MOUNT_NOAUTO    = 1 << 0,

M systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch => systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch +11 -6
@@ 1,4 1,4 @@
From fb068403b25002156435350165ea418a6338a313 Mon Sep 17 00:00:00 2001
From 74c664bcd6b9a5fcf3466310c07f608d12456f7f Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 14:56:21 +0800
Subject: [PATCH] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not defined


@@ 23,6 23,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 src/tmpfiles/tmpfiles.c   | 10 ++++++++++
 3 files changed, 38 insertions(+)

diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
index e026b29478..815e56ef68 100644
--- a/src/basic/glob-util.c
+++ b/src/basic/glob-util.c
@@ -12,6 +12,12 @@


@@ 46,7 48,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
         assert(!(flags & GLOB_ALTDIRFUNC));
 
@@ -32,9 +39,14 @@ int safe_glob(const char *path, int flag
@@ -32,9 +39,14 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
                 pglob->gl_lstat = lstat;
         if (!pglob->gl_stat)
                 pglob->gl_stat = stat;


@@ 61,6 63,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (k == GLOB_NOMATCH)
                 return -ENOENT;
         if (k == GLOB_NOSPACE)
diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
index ec8b74f48f..d99a6095df 100644
--- a/src/test/test-glob-util.c
+++ b/src/test/test-glob-util.c
@@ -13,6 +13,12 @@


@@ 110,6 114,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         assert_se(r == GLOB_NOMATCH);
 
         (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index fcab51c208..fdef1807ae 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -67,6 +67,12 @@


@@ 125,7 131,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
  * them in the file system. This is intended to be used to create
  * properly owned directories beneath /tmp, /var/tmp, /run, which are
@@ -1961,7 +1967,9 @@ finish:
@@ -1934,7 +1940,9 @@ finish:
 
 static int glob_item(Item *i, action_t action) {
         _cleanup_globfree_ glob_t g = {


@@ 134,8 140,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+#endif
         };
         int r = 0, k;
         char **fn;
@@ -1981,7 +1989,9 @@ static int glob_item(Item *i, action_t a

@@ -1953,7 +1961,9 @@ static int glob_item(Item *i, action_t action) {
 
 static int glob_item_recursively(Item *i, fdaction_t action) {
         _cleanup_globfree_ glob_t g = {


@@ 144,4 150,3 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+#endif
         };
         int r = 0, k;
         char **fn;

M systemd/0008-add-missing-FTW_-macros-for-musl.patch => systemd/0008-add-missing-FTW_-macros-for-musl.patch +11 -33
@@ 1,4 1,4 @@
From 7ca9887f84adba065dc2e59b3de55ace2fc72ec0 Mon Sep 17 00:00:00 2001
From a0450f7909348e7ff1d58adc0aee4119a0519c1f Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:00:06 +0800
Subject: [PATCH] add missing FTW_ macros for musl


@@ 12,46 12,24 @@ Upstream-Status: Inappropriate [musl specific]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

---
 src/basic/missing_type.h | 20 ++++++++++++++++++++
 src/shared/mount-setup.c |  1 +
 2 files changed, 21 insertions(+)
 src/basic/missing_type.h    | 4 ++++
 src/test/test-recurse-dir.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
index 6c0456349d..73a5b90e3c 100644
--- a/src/basic/missing_type.h
+++ b/src/basic/missing_type.h
@@ -19,3 +19,23 @@ typedef int (*comparison_fn_t)(const voi
 #define __COMPAR_FN_T
 typedef int (*__compar_fn_t)(const void *, const void *);
@@ -14,3 +14,7 @@
 #ifndef __GLIBC__
 typedef int (*comparison_fn_t)(const void *, const void *);
 #endif
+
+#ifndef FTW_ACTIONRETVAL
+#define FTW_ACTIONRETVAL 16
+#endif
+
+#ifndef FTW_CONTINUE
+#define FTW_CONTINUE 0
+#endif
+
+#ifndef FTW_STOP
+#define FTW_STOP 1
+#endif
+
+#ifndef FTW_SKIP_SUBTREE
+#define FTW_SKIP_SUBTREE 2
+#endif
+
+#ifndef FTW_SKIP_SIBLINGS
+#define FTW_SKIP_SIBLINGS 3
+#endif
--- a/src/shared/mount-setup.c
+++ b/src/shared/mount-setup.c
@@ -32,6 +32,7 @@
 #include "strv.h"
 #include "user-util.h"
 #include "virt.h"
+#include "missing_type.h"
 
 typedef enum MountMode {
         MNT_NONE           = 0,
diff --git a/src/test/test-recurse-dir.c b/src/test/test-recurse-dir.c
index 2c2120b136..bc60a178a2 100644
--- a/src/test/test-recurse-dir.c
+++ b/src/test/test-recurse-dir.c
@@ -6,6 +6,7 @@

D systemd/0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch => systemd/0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch +0 -43
@@ 1,43 0,0 @@
From 943b4258b870c65caaa56fe4dad0d9c7281fdb1d Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:03:47 +0800
Subject: [PATCH] fix missing of __register_atfork for non-glibc builds

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

---
 src/basic/process-util.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 14259ea8df..18681838ef 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -18,6 +18,9 @@
 #if HAVE_VALGRIND_VALGRIND_H
 #include <valgrind/valgrind.h>
 #endif
+#ifndef __GLIBC__
+#include <pthread.h>
+#endif
 
 #include "alloc-util.h"
 #include "architecture.h"
@@ -1202,11 +1205,15 @@ void reset_cached_pid(void) {
         cached_pid = CACHED_PID_UNSET;
 }
 
+#ifdef __GLIBC__
 /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
  * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
  * libpthread, as it is part of glibc anyway. */
 extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle);
 extern void* __dso_handle _weak_;
+#else
+#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child)
+#endif
 
 pid_t getpid_cached(void) {
         static bool installed = false;

M systemd/0010-Use-uintmax_t-for-handling-rlim_t.patch => systemd/0010-Use-uintmax_t-for-handling-rlim_t.patch +11 -5
@@ 1,4 1,4 @@
From 856010e268a6aca8e5f02502457afe289bd877f1 Mon Sep 17 00:00:00 2001
From 48a791aae7a47a2a08e9e60c18054071a43b8cda Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:12:41 +0800
Subject: [PATCH] Use uintmax_t for handling rlim_t


@@ 27,9 27,11 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
 src/core/execute.c      |  4 ++--
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/basic/format-util.h b/src/basic/format-util.h
index 8719df3e29..9becc96066 100644
--- a/src/basic/format-util.h
+++ b/src/basic/format-util.h
@@ -34,13 +34,7 @@ assert_cc(sizeof(gid_t) == sizeof(uint32
@@ -34,13 +34,7 @@ assert_cc(sizeof(gid_t) == sizeof(uint32_t));
 #  error Unknown timex member size
 #endif
 


@@ 44,9 46,11 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
 
 #if SIZEOF_DEV_T == 8
 #  define DEV_FMT "%" PRIu64
diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
index 33dfde9d6c..e018fd81fd 100644
--- a/src/basic/rlimit-util.c
+++ b/src/basic/rlimit-util.c
@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, cons
@@ -44,7 +44,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) {
             fixed.rlim_max == highest.rlim_max)
                 return 0;
 


@@ 55,7 59,7 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
 
         return RET_NERRNO(setrlimit(resource, &fixed));
 }
@@ -307,13 +307,13 @@ int rlimit_format(const struct rlimit *r
@@ -307,13 +307,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
         if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
                 r = free_and_strdup(&s, "infinity");
         else if (rl->rlim_cur >= RLIM_INFINITY)


@@ 82,9 86,11 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
 
         return 1;
 }
diff --git a/src/core/execute.c b/src/core/execute.c
index fccfb9268c..90f00e10a5 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -5639,9 +5639,9 @@ void exec_context_dump(const ExecContext
@@ -5633,9 +5633,9 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
         for (unsigned i = 0; i < RLIM_NLIMITS; i++)
                 if (c->rlimit[i]) {
                         fprintf(f, "%sLimit%s: " RLIM_FMT "\n",

M systemd/0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch => systemd/0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch +5 -3
@@ 1,4 1,4 @@
From ad395dda5db9b1ae156be121cfc8a38960de6c55 Mon Sep 17 00:00:00 2001
From e8025c8eefdf1be4bba34c48f3430838f3859c52 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 28 Feb 2018 21:25:22 -0800
Subject: [PATCH] test-sizeof.c: Disable tests for missing typedefs in musl


@@ 12,12 12,14 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
 src/test/test-sizeof.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index f349852553..602772227e 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -55,8 +55,10 @@ int main(void) {
         info(unsigned);
         info(long unsigned);
         info(long long unsigned);
         info(unsigned long);
         info(unsigned long long);
+#ifdef __GLIBC__
         info(__syscall_ulong_t);
         info(__syscall_slong_t);

M systemd/0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch => systemd/0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch +4 -2
@@ 1,4 1,4 @@
From 30b08f76ea7f5c324afedf97f0867b76dac9f128 Mon Sep 17 00:00:00 2001
From e480d28305907c3874f4e58b722b8aa43c3ac7a2 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Wed, 4 Jul 2018 15:00:44 +0800
Subject: [PATCH] Do not disable buffering when writing to oom_score_adj


@@ 24,9 24,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 src/basic/process-util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 6980e0c4f6..45ec26ea45 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -1489,7 +1489,7 @@ int set_oom_score_adjust(int value) {
@@ -1460,7 +1460,7 @@ int set_oom_score_adjust(int value) {
         xsprintf(t, "%i", value);
 
         return write_string_file("/proc/self/oom_score_adj", t,

M systemd/0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch => systemd/0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch +7 -3
@@ 1,4 1,4 @@
From 873202f63f9f117c6e5a98e444cc709057042979 Mon Sep 17 00:00:00 2001
From 0542d27ebbb250c09bdcfcf9f2ea3d27426fe522 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Tue, 10 Jul 2018 15:40:17 +0800
Subject: [PATCH] distinguish XSI-compliant strerror_r from GNU-specifi


@@ 24,9 24,11 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
 src/libsystemd/sd-journal/journal-send.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
index bdfa145ab7..61928f4bf3 100644
--- a/src/libsystemd/sd-bus/bus-error.c
+++ b/src/libsystemd/sd-bus/bus-error.c
@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_er
@@ -409,7 +409,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
                         return;
 
                 errno = 0;


@@ 39,9 41,11 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
                 if (errno == ERANGE || strlen(x) >= k - 1) {
                         free(m);
                         k *= 2;
diff --git a/src/libsystemd/sd-journal/journal-send.c b/src/libsystemd/sd-journal/journal-send.c
index e6ceba54f9..285ebbc9ef 100644
--- a/src/libsystemd/sd-journal/journal-send.c
+++ b/src/libsystemd/sd-journal/journal-send.c
@@ -348,7 +348,12 @@ static int fill_iovec_perror_and_send(co
@@ -370,7 +370,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
                 char* j;
 
                 errno = 0;

M systemd/0018-avoid-redefinition-of-prctl_mm_map-structure.patch => systemd/0018-avoid-redefinition-of-prctl_mm_map-structure.patch +1 -1
@@ 1,4 1,4 @@
From 748c4cf040856857f24f4aeef6d996bd58573bd3 Mon Sep 17 00:00:00 2001
From e1d0210b47906dd121f936f3181092835df6a95c Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 15:44:54 +0800
Subject: [PATCH] avoid redefinition of prctl_mm_map structure

D systemd/0021-test-json.c-define-M_PIl.patch => systemd/0021-test-json.c-define-M_PIl.patch +0 -29
@@ 1,29 0,0 @@
From 47472da6e8900773c26da8fd26699367447d97a6 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Mon, 25 Feb 2019 16:53:06 +0800
Subject: [PATCH] test-json.c: define M_PIl

Fix the following compile failure:
src/test/test-json.c:305:50: error: 'M_PIl' undeclared (first use in this function); did you mean 'M_PI'?

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>

---
 src/test/test-json.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/src/test/test-json.c
+++ b/src/test/test-json.c
@@ -14,6 +14,10 @@
 #include "tests.h"
 #include "util.h"
 
+#ifndef M_PIl
+#define M_PIl 3.141592653589793238462643383279502884L
+#endif
+
 static void test_tokenizer_one(const char *data, ...) {
         unsigned line = 0, column = 0;
         void *state = NULL;

M systemd/0022-do-not-disable-buffer-in-writing-files.patch => systemd/0022-do-not-disable-buffer-in-writing-files.patch +153 -106
@@ 1,4 1,4 @@
From 0f9422780a569c79a4b28e44c79c70b4a354bd92 Mon Sep 17 00:00:00 2001
From 414e2f97008a1f3c26a260a6dc4d51a8c1fa6900 Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Fri, 1 Mar 2019 15:22:15 +0800
Subject: [PATCH] do not disable buffer in writing files


@@ 20,27 20,34 @@ Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Scott Murray <scott.murray@konsulko.com>

---
 src/basic/cgroup-util.c                 | 10 +++++-----
 src/basic/cgroup-util.c                 | 12 ++++++------
 src/basic/namespace-util.c              |  4 ++--
 src/basic/procfs-util.c                 |  4 ++--
 src/basic/sysctl-util.c                 |  2 +-
 src/basic/util.c                        |  2 +-
 src/binfmt/binfmt.c                     |  6 +++---
 src/core/cgroup.c                       |  2 +-
 src/core/main.c                         |  4 ++--
 src/core/smack-setup.c                  |  8 ++++----
 src/hibernate-resume/hibernate-resume.c |  2 +-
 src/home/homework.c                     |  2 +-
 src/libsystemd/sd-device/sd-device.c    |  2 +-
 src/nspawn/nspawn-cgroup.c              |  2 +-
 src/nspawn/nspawn.c                     |  6 +++---
 src/shared/binfmt-util.c                |  2 +-
 src/shared/cgroup-setup.c               |  4 ++--
 src/shared/mount-util.c                 |  4 ++--
 src/shared/coredump-util.c              |  2 +-
 src/shared/smack-util.c                 |  2 +-
 src/sleep/sleep.c                       |  8 ++++----
 src/udev/udev-rules.c                   |  1 -
 src/vconsole/vconsole-setup.c           |  2 +-
 16 files changed, 34 insertions(+), 34 deletions(-)
 21 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index f4615ffce1..07cb8ed669 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -390,7 +390,7 @@ int cg_kill_kernel_sigkill(const char *c
@@ -399,7 +399,7 @@ int cg_kill_kernel_sigkill(const char *controller, const char *path) {
         if (r < 0)
                 return r;
 


@@ 49,7 56,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return r;
 
@@ -803,7 +803,7 @@ int cg_install_release_agent(const char
@@ -805,7 +805,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
 
         sc = strstrip(contents);
         if (isempty(sc)) {


@@ 58,7 65,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                 if (r < 0)
                         return r;
         } else if (!path_equal(sc, agent))
@@ -821,7 +821,7 @@ int cg_install_release_agent(const char
@@ -823,7 +823,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
 
         sc = strstrip(contents);
         if (streq(sc, "0")) {


@@ 67,7 74,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                 if (r < 0)
                         return r;
 
@@ -848,7 +848,7 @@ int cg_uninstall_release_agent(const cha
@@ -850,7 +850,7 @@ int cg_uninstall_release_agent(const char *controller) {
         if (r < 0)
                 return r;
 


@@ 76,7 83,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return r;
 
@@ -858,7 +858,7 @@ int cg_uninstall_release_agent(const cha
@@ -860,7 +860,7 @@ int cg_uninstall_release_agent(const char *controller) {
         if (r < 0)
                 return r;
 


@@ 85,7 92,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return r;
 
@@ -1704,7 +1704,7 @@ int cg_set_attribute(const char *control
@@ -1730,7 +1730,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri
         if (r < 0)
                 return r;
 


@@ 94,9 101,30 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 }
 
 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
diff --git a/src/basic/namespace-util.c b/src/basic/namespace-util.c
index b9120a5ed0..78e460b75f 100644
--- a/src/basic/namespace-util.c
+++ b/src/basic/namespace-util.c
@@ -202,12 +202,12 @@ int userns_acquire(const char *uid_map, const char *gid_map) {
                 freeze();
 
         xsprintf(path, "/proc/" PID_FMT "/uid_map", pid);
-        r = write_string_file(path, uid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(path, uid_map, 0);
         if (r < 0)
                 return log_error_errno(r, "Failed to write UID map: %m");
 
         xsprintf(path, "/proc/" PID_FMT "/gid_map", pid);
-        r = write_string_file(path, gid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(path, gid_map, 0);
         if (r < 0)
                 return log_error_errno(r, "Failed to write GID map: %m");
 
diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
index e485a0196b..8bff210356 100644
--- a/src/basic/procfs-util.c
+++ b/src/basic/procfs-util.c
@@ -64,13 +64,13 @@ int procfs_tasks_set_limit(uint64_t limi
@@ -64,13 +64,13 @@ int procfs_tasks_set_limit(uint64_t limit) {
          * decrease it, as threads-max is the much more relevant sysctl. */
         if (limit > pid_max-1) {
                 sprintf(buffer, "%" PRIu64, limit+1); /* Add one, since PID 0 is not a valid PID */


@@ 112,9 140,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0) {
                 uint64_t threads_max;
 
diff --git a/src/basic/sysctl-util.c b/src/basic/sysctl-util.c
index b66a6622ae..8d1c93008a 100644
--- a/src/basic/sysctl-util.c
+++ b/src/basic/sysctl-util.c
@@ -58,7 +58,7 @@ int sysctl_write(const char *property, c
@@ -58,7 +58,7 @@ int sysctl_write(const char *property, const char *value) {
 
         log_debug("Setting '%s' to '%s'", p, value);
 


@@ 123,6 153,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 }
 
 int sysctl_writef(const char *property, const char *format, ...) {
diff --git a/src/basic/util.c b/src/basic/util.c
index d7ef382737..31c35118d1 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -168,7 +168,7 @@ void disable_coredumps(void) {


@@ 134,6 166,8 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
 }
diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
index 18231c2618..6c598d55c8 100644
--- a/src/binfmt/binfmt.c
+++ b/src/binfmt/binfmt.c
@@ -29,7 +29,7 @@ static bool arg_unregister = false;


@@ 145,7 179,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
 }
 
 static int apply_rule(const char *filename, unsigned line, const char *rule) {
@@ -59,7 +59,7 @@ static int apply_rule(const char *filena
@@ -59,7 +59,7 @@ static int apply_rule(const char *filename, unsigned line, const char *rule) {
         if (r >= 0)
                 log_debug("%s:%u: Rule '%s' deleted.", filename, line, rulename);
 


@@ 154,7 188,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return log_error_errno(r, "%s:%u: Failed to add binary format '%s': %m",
                                        filename, line, rulename);
@@ -226,7 +226,7 @@ static int run(int argc, char *argv[]) {
@@ -225,7 +225,7 @@ static int run(int argc, char *argv[]) {
                 }
 
                 /* Flush out all rules */


@@ 163,9 197,24 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                 if (r < 0)
                         log_warning_errno(r, "Failed to flush binfmt_misc rules, ignoring: %m");
                 else
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 9282b1ff20..7781e0f8eb 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -4182,7 +4182,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) {
         else
                 u->freezer_state = FREEZER_THAWING;
 
-        r = write_string_file(path, one_zero(action == FREEZER_FREEZE), WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(path, one_zero(action == FREEZER_FREEZE), 0);
         if (r < 0)
                 return r;
 
diff --git a/src/core/main.c b/src/core/main.c
index 409b84a006..b1631e57ce 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1466,7 +1466,7 @@ static int bump_unix_max_dgram_qlen(void
@@ -1374,7 +1374,7 @@ static int bump_unix_max_dgram_qlen(void) {
         if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN)
                 return 0;
 


@@ 174,7 223,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                                "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
         if (r < 0)
                 return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r,
@@ -1737,7 +1737,7 @@ static void initialize_core_pattern(bool
@@ -1646,7 +1646,7 @@ static void initialize_core_pattern(bool skip_setup) {
         if (getpid_cached() != 1)
                 return;
 


@@ 183,9 232,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m",
                                   arg_early_core_pattern);
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
index f88cb80834..68055fb64a 100644
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -320,17 +320,17 @@ int mac_smack_setup(bool *loaded_policy)
@@ -320,17 +320,17 @@ int mac_smack_setup(bool *loaded_policy) {
         }
 
 #if HAVE_SMACK_RUN_LABEL


@@ 207,20 258,37 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m");
 #endif
diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c
index 1c7d9179d8..3ae78ee580 100644
--- a/src/hibernate-resume/hibernate-resume.c
+++ b/src/hibernate-resume/hibernate-resume.c
@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
@@ -40,7 +40,7 @@ int main(int argc, char *argv[]) {
                 return EXIT_FAILURE;
         }
 
-        r = write_string_file("/sys/power/resume", major_minor, WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/sys/power/resume", major_minor, 0);
-        r = write_string_file("/sys/power/resume", FORMAT_DEVNUM(st.st_rdev), WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/sys/power/resume", FORMAT_DEVNUM(st.st_rdev), 0);
         if (r < 0) {
                 log_error_errno(r, "Failed to write '%s' to /sys/power/resume: %m", major_minor);
                 log_error_errno(r, "Failed to write '" DEVNUM_FORMAT_STR "' to /sys/power/resume: %m", DEVNUM_FORMAT_VAL(st.st_rdev));
                 return EXIT_FAILURE;
diff --git a/src/home/homework.c b/src/home/homework.c
index 0014a7f598..ec3e9caa1c 100644
--- a/src/home/homework.c
+++ b/src/home/homework.c
@@ -278,7 +278,7 @@ static void drop_caches_now(void) {
          * details. We write "2" into /proc/sys/vm/drop_caches to ensure dentries/inodes are flushed, but not
          * more. */
 
-        r = write_string_file("/proc/sys/vm/drop_caches", "2\n", WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/proc/sys/vm/drop_caches", "2\n", 0);
         if (r < 0)
                 log_warning_errno(r, "Failed to drop caches, ignoring: %m");
         else
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index aaf951ced8..45a9d70f0d 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -2108,7 +2108,7 @@ _public_ int sd_device_set_sysattr_value
@@ -2215,7 +2215,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr,
         if (!value)
                 return -ENOMEM;
 


@@ 229,9 297,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0) {
                 /* On failure, clear cache entry, as we do not know how it fails. */
                 device_remove_cached_sysattr_value(device, sysattr);
diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c
index 9e6379ae7b..546a03a7f5 100644
--- a/src/nspawn/nspawn-cgroup.c
+++ b/src/nspawn/nspawn-cgroup.c
@@ -124,7 +124,7 @@ int sync_cgroup(pid_t pid, CGroupUnified
@@ -123,7 +123,7 @@ int sync_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) {
         fn = strjoina(tree, cgroup, "/cgroup.procs");
 
         sprintf(pid_string, PID_FMT, pid);


@@ 240,9 310,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0) {
                 log_error_errno(r, "Failed to move process: %m");
                 goto finish;
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index c5fd978395..fefe8a21e5 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2757,7 +2757,7 @@ static int reset_audit_loginuid(void) {
@@ -2759,7 +2759,7 @@ static int reset_audit_loginuid(void) {
         if (streq(p, "4294967295"))
                 return 0;
 


@@ 251,7 323,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0) {
                 log_error_errno(r,
                                 "Failed to reset audit login UID. This probably means that your kernel is too\n"
@@ -4163,7 +4163,7 @@ static int setup_uid_map(
@@ -4187,7 +4187,7 @@ static int setup_uid_map(
                 return log_oom();
 
         xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);


@@ 260,7 332,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return log_error_errno(r, "Failed to write UID map: %m");
 
@@ -4173,7 +4173,7 @@ static int setup_uid_map(
@@ -4197,7 +4197,7 @@ static int setup_uid_map(
                 return log_oom();
 
         xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);


@@ 269,18 341,33 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return log_error_errno(r, "Failed to write GID map: %m");
 
diff --git a/src/shared/binfmt-util.c b/src/shared/binfmt-util.c
index 724d7f27d9..dd725cff92 100644
--- a/src/shared/binfmt-util.c
+++ b/src/shared/binfmt-util.c
@@ -26,7 +26,7 @@ int disable_binfmt(void) {
         if (r < 0)
                 return log_warning_errno(r, "Failed to determine whether binfmt_misc is mounted: %m");
 
-        r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
         if (r < 0)
                 return log_warning_errno(r, "Failed to unregister binfmt_misc entries: %m");
 
diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c
index a1fabc73c1..c5c8fc417e 100644
--- a/src/shared/cgroup-setup.c
+++ b/src/shared/cgroup-setup.c
@@ -345,7 +345,7 @@ int cg_attach(const char *controller, co
@@ -344,7 +344,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) {
 
         xsprintf(c, PID_FMT "\n", pid);
 
-        r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(fs, c, 0);
         if (r < 0)
                 return r;
 
@@ -877,7 +877,7 @@ int cg_enable_everywhere(
         if (r == -EOPNOTSUPP && cg_is_threaded(controller, path) > 0)
                 /* When the threaded mode is used, we cannot read/write the file. Let's return recognizable error. */
                 return -EUCLEAN;
@@ -879,7 +879,7 @@ int cg_enable_everywhere(
                                         return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p);
                         }
 


@@ 289,9 376,22 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                         if (r < 0) {
                                 log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m",
                                                 FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs);
diff --git a/src/shared/coredump-util.c b/src/shared/coredump-util.c
index a0b648bf79..13f921390d 100644
--- a/src/shared/coredump-util.c
+++ b/src/shared/coredump-util.c
@@ -70,5 +70,5 @@ int set_coredump_filter(uint64_t value) {
         sprintf(t, "0x%"PRIx64, value);
 
         return write_string_file("/proc/self/coredump_filter", t,
-                                 WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
+                                 WRITE_STRING_FILE_VERIFY_ON_FAILURE);
 }
diff --git a/src/shared/smack-util.c b/src/shared/smack-util.c
index 0df1778cb2..3b9a0c934e 100644
--- a/src/shared/smack-util.c
+++ b/src/shared/smack-util.c
@@ -114,7 +114,7 @@ int mac_smack_apply_pid(pid_t pid, const
@@ -114,7 +114,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
                 return 0;
 
         p = procfs_file_alloca(pid, "attr/current");


@@ 300,9 400,11 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return r;
 
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index 7064f3a905..8f2a7d9da2 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -46,7 +46,7 @@ static int write_hibernate_location_info
@@ -46,7 +46,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca
         assert(hibernate_location->swap);
 
         xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno));


@@ 311,7 413,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m",
                                        hibernate_location->swap->device, resume_str);
@@ -73,7 +73,7 @@ static int write_hibernate_location_info
@@ -73,7 +73,7 @@ static int write_hibernate_location_info(const HibernateLocation *hibernate_loca
         }
 
         xsprintf(offset_str, "%" PRIu64, hibernate_location->offset);


@@ 320,7 422,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return log_debug_errno(r, "Failed to write swap file offset to /sys/power/resume_offset for '%s': '%s': %m",
                                        hibernate_location->swap->device, offset_str);
@@ -90,7 +90,7 @@ static int write_mode(char **modes) {
@@ -89,7 +89,7 @@ static int write_mode(char **modes) {
         STRV_FOREACH(mode, modes) {
                 int k;
 


@@ 329,7 431,7 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                 if (k >= 0)
                         return 0;
 
@@ -112,7 +112,7 @@ static int write_state(FILE **f, char **
@@ -110,7 +110,7 @@ static int write_state(FILE **f, char **states) {
         STRV_FOREACH(state, states) {
                 int k;
 


@@ 338,9 440,23 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
                 if (k >= 0)
                         return 0;
                 log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m", *state);
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index cd858c9cca..0feb9669a0 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -2335,7 +2335,6 @@ static int udev_rule_apply_token_to_event(
                 log_rule_debug(dev, rules, "ATTR '%s' writing '%s'", buf, value);
                 r = write_string_file(buf, value,
                                       WRITE_STRING_FILE_VERIFY_ON_FAILURE |
-                                      WRITE_STRING_FILE_DISABLE_BUFFER |
                                       WRITE_STRING_FILE_AVOID_NEWLINE |
                                       WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE);
                 if (r < 0)
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 50930d4af3..5efd5d3728 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -108,7 +108,7 @@ static int toggle_utf8_vc(const char *na
@@ -108,7 +108,7 @@ static int toggle_utf8_vc(const char *name, int fd, bool utf8) {
 static int toggle_utf8_sysfs(bool utf8) {
         int r;
 


@@ 349,72 465,3 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
         if (r < 0)
                 return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
 
--- a/src/basic/namespace-util.c
+++ b/src/basic/namespace-util.c
@@ -202,12 +202,12 @@ int userns_acquire(const char *uid_map,
                 freeze();
 
         xsprintf(path, "/proc/" PID_FMT "/uid_map", pid);
-        r = write_string_file(path, uid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(path, uid_map, 0);
         if (r < 0)
                 return log_error_errno(r, "Failed to write UID map: %m");
 
         xsprintf(path, "/proc/" PID_FMT "/gid_map", pid);
-        r = write_string_file(path, gid_map, WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(path, gid_map, 0);
         if (r < 0)
                 return log_error_errno(r, "Failed to write GID map: %m");
 
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -4140,7 +4140,7 @@ int unit_cgroup_freezer_action(Unit *u,
         else
                 u->freezer_state = FREEZER_THAWING;
 
-        r = write_string_file(path, one_zero(action == FREEZER_FREEZE), WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file(path, one_zero(action == FREEZER_FREEZE), 0);
         if (r < 0)
                 return r;
 
--- a/src/home/homework.c
+++ b/src/home/homework.c
@@ -284,7 +284,7 @@ static void drop_caches_now(void) {
          * details. We write "2" into /proc/sys/vm/drop_caches to ensure dentries/inodes are flushed, but not
          * more. */
 
-        r = write_string_file("/proc/sys/vm/drop_caches", "2\n", WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/proc/sys/vm/drop_caches", "2\n", 0);
         if (r < 0)
                 log_warning_errno(r, "Failed to drop caches, ignoring: %m");
         else
--- a/src/shared/binfmt-util.c
+++ b/src/shared/binfmt-util.c
@@ -26,7 +26,7 @@ int disable_binfmt(void) {
         if (r < 0)
                 return log_warning_errno(r, "Failed to determine whether binfmt_misc is mounted: %m");
 
-        r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
+        r = write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
         if (r < 0)
                 return log_warning_errno(r, "Failed to unregister binfmt_misc entries: %m");
 
--- a/src/shared/coredump-util.c
+++ b/src/shared/coredump-util.c
@@ -70,5 +70,5 @@ int set_coredump_filter(uint64_t value)
         sprintf(t, "0x%"PRIx64, value);
 
         return write_string_file("/proc/self/coredump_filter", t,
-                                 WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
+                                 WRITE_STRING_FILE_VERIFY_ON_FAILURE);
 }
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -2181,7 +2181,6 @@ static int udev_rule_apply_token_to_even
                 log_rule_debug(dev, rules, "ATTR '%s' writing '%s'", buf, value);
                 r = write_string_file(buf, value,
                                       WRITE_STRING_FILE_VERIFY_ON_FAILURE |
-                                      WRITE_STRING_FILE_DISABLE_BUFFER |
                                       WRITE_STRING_FILE_AVOID_NEWLINE |
                                       WRITE_STRING_FILE_VERIFY_IGNORE_NEWLINE);
                 if (r < 0)

M systemd/0025-Handle-__cpu_mask-usage.patch => systemd/0025-Handle-__cpu_mask-usage.patch +2 -2
@@ 1,4 1,4 @@
From 5fa412dcebe89fd9f6f6003163f17e0dc719df34 Mon Sep 17 00:00:00 2001
From 8871f78c559f37169c0cfaf20b0af1dbec0399af Mon Sep 17 00:00:00 2001
From: Scott Murray <scott.murray@konsulko.com>
Date: Fri, 13 Sep 2019 19:26:27 -0400
Subject: [PATCH] Handle __cpu_mask usage


@@ 38,7 38,7 @@ index 3c63a58826..4c2d4347fc 100644
 typedef struct CPUSet {
         cpu_set_t *set;
diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
index 4403c0aa52..e7e4ae112d 100644
index 602772227e..7f1ed19d77 100644
--- a/src/test/test-sizeof.c
+++ b/src/test/test-sizeof.c
@@ -1,6 +1,5 @@

M systemd/0026-Handle-missing-gshadow.patch => systemd/0026-Handle-missing-gshadow.patch +11 -5
@@ 1,4 1,4 @@
From 66a926cf906260c2fb5ea851e55efe03edd444dc Mon Sep 17 00:00:00 2001
From ec519727bb1ceda6e7787ccf86237a6aad07137c Mon Sep 17 00:00:00 2001
From: Alex Kiernan <alex.kiernan@gmail.com>
Date: Tue, 10 Mar 2020 11:05:20 +0000
Subject: [PATCH] Handle missing gshadow


@@ 17,6 17,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 src/shared/userdb.c          |  7 ++++++-
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/shared/user-record-nss.c b/src/shared/user-record-nss.c
index 88b8fc2f8f..a819d41bac 100644
--- a/src/shared/user-record-nss.c
+++ b/src/shared/user-record-nss.c
@@ -331,8 +331,10 @@ int nss_group_to_group_record(


@@ 46,7 48,7 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 
         r = json_build(&g->json, JSON_BUILD_OBJECT(
                                        JSON_BUILD_PAIR("groupName", JSON_BUILD_STRING(g->group_name)),
@@ -388,6 +392,7 @@ int nss_sgrp_for_group(const struct grou
@@ -388,6 +392,7 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re
         assert(ret_sgrp);
         assert(ret_buffer);
 


@@ 54,7 56,7 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
         for (;;) {
                 _cleanup_free_ char *buf = NULL;
                 struct sgrp sgrp, *result;
@@ -416,6 +421,9 @@ int nss_sgrp_for_group(const struct grou
@@ -416,6 +421,9 @@ int nss_sgrp_for_group(const struct group *grp, struct sgrp *ret_sgrp, char **re
                 buflen *= 2;
                 buf = mfree(buf);
         }


@@ 120,6 122,8 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
         if (r < 0)
                 return r;
 
diff --git a/src/shared/user-record-nss.h b/src/shared/user-record-nss.h
index 22ab04d6ee..4e52e7a911 100644
--- a/src/shared/user-record-nss.h
+++ b/src/shared/user-record-nss.h
@@ -2,7 +2,11 @@


@@ 134,9 138,11 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
 #include <pwd.h>
 #include <shadow.h>
 
diff --git a/src/shared/userdb.c b/src/shared/userdb.c
index 0eddd382e6..d506b8e263 100644
--- a/src/shared/userdb.c
+++ b/src/shared/userdb.c
@@ -1046,13 +1046,15 @@ int groupdb_iterator_get(UserDBIterator
@@ -1046,13 +1046,15 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) {
                 if (gr) {
                         _cleanup_free_ char *buffer = NULL;
                         bool incomplete = false;


@@ 153,7 159,7 @@ Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
                         if (!FLAGS_SET(iterator->flags, USERDB_SUPPRESS_SHADOW)) {
                                 r = nss_sgrp_for_group(gr, &sgrp, &buffer);
                                 if (r < 0) {
@@ -1065,6 +1067,9 @@ int groupdb_iterator_get(UserDBIterator
@@ -1065,6 +1067,9 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) {
                         }
 
                         r = nss_group_to_group_record(gr, r >= 0 ? &sgrp : NULL, ret);

D systemd/0102-test-resolved-stream-explicit-cast-sockaddr_in-point.patch => systemd/0102-test-resolved-stream-explicit-cast-sockaddr_in-point.patch +0 -34
@@ 1,34 0,0 @@
From 3dd757a4eba8f9ee3c2795b131c6dc029d0b2017 Mon Sep 17 00:00:00 2001
From: xdavidwu <xdavidwuph@gmail.com>
Date: Fri, 29 Apr 2022 10:31:39 +0800
Subject: [PATCH] test-resolved-stream: explicit cast sockaddr_in pointers

---
 src/resolve/test-resolved-stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/resolve/test-resolved-stream.c b/src/resolve/test-resolved-stream.c
index f12c729e50..b8c4654854 100644
--- a/src/resolve/test-resolved-stream.c
+++ b/src/resolve/test-resolved-stream.c
@@ -109,7 +109,7 @@ static void *tcp_dns_server(void *p) {
 
         assert_se((bindfd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0)) >= 0);
         assert_se(setsockopt(bindfd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int)) >= 0);
-        assert_se(bind(bindfd, &SERVER_ADDRESS, sizeof(SERVER_ADDRESS)) >= 0);
+        assert_se(bind(bindfd, (struct sockaddr *)&SERVER_ADDRESS, sizeof(SERVER_ADDRESS)) >= 0);
         assert_se(listen(bindfd, 1) >= 0);
         assert_se((acceptfd = accept(bindfd, NULL, NULL)) >= 0);
         server_handle(acceptfd);
@@ -248,7 +248,7 @@ static void test_dns_stream(bool tls) {
         assert_se((clientfd = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0)) >= 0);
 
         for (int i = 0; i < 100; i++) {
-                r = connect(clientfd, &SERVER_ADDRESS, sizeof(SERVER_ADDRESS));
+                r = connect(clientfd, (struct sockaddr *)&SERVER_ADDRESS, sizeof(SERVER_ADDRESS));
                 if (r >= 0)
                         break;
                 usleep(EVENT_TIMEOUT_USEC / 100);
-- 
2.36.0


M systemd/APKBUILD => systemd/APKBUILD +18 -24
@@ 1,7 1,7 @@
# Contributor: xdavidwu <xdavidwuph@gmail.com>
# Maintainer: xdavidwu <xdavidwuph@gmail.com>
pkgname=systemd
pkgver=250.7
pkgver=251.2
pkgrel=0
pkgdesc="System and Service Manager"
url="https://www.github.com/systemd/systemd"


@@ 23,19 23,16 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/systemd/systemd-stable/archi
	0005-src-basic-missing.h-check-for-missing-strndupa.patch
	0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
	0008-add-missing-FTW_-macros-for-musl.patch
	0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch
	0010-Use-uintmax_t-for-handling-rlim_t.patch
	0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
	0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
	0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
	0018-avoid-redefinition-of-prctl_mm_map-structure.patch
	0021-test-json.c-define-M_PIl.patch
	0022-do-not-disable-buffer-in-writing-files.patch	
	0025-Handle-__cpu_mask-usage.patch
	0026-Handle-missing-gshadow.patch
	0100-Do-not-buffer-on-systemd-sleep.patch
	0101-efi-do-not-set-wide-exec-charset.patch
	0102-test-resolved-stream-explicit-cast-sockaddr_in-point.patch"
	0101-efi-do-not-set-wide-exec-charset.patch"
pkgusers="systemd-network systemd-resolve systemd-coredump"
pkggroups="systemd-journal"
provides="hwids-udev=99999999 eudev=99 eudev-libs=99"


@@ 142,26 139,23 @@ package() {
}

sha512sums="
99bc6f0c9757b280cb694f3fb4d6fe04d5ce55583eb2bae5ddeb324bb5ee9930c1720fcc27293d90cddba188473653ec541a471ae8115710a5850c26d0ba215d  systemd-250.7.tar.gz
adfdf309b414d86fc754733cd7eef7d3f4830d7092b5db09376243669962b672a3b5d79d8c4ef0c992d3baab2b1fb425125f4abf264d3cfd3b533ddd26f85999  0001-Adjust-for-musl-headers.patch
b411e5dcb6bfa9608c0c22f2397eee80c711c41afece91a1132864ff83041d0889fc91ed200d3525d2a8247865dc06c71accaa861035ef50d1b772b5990042f7  0001-pass-correct-parameters-to-getdents64.patch
e494fb8fc915a4d6eb50dd4a5aca205b151a547eb7ef0f42dc61f685dd7732482e462ebc28f1ec625b2b7356451eac3aba037ff72b7f30ac277c0f371d8bd403  0002-Add-sys-stat.h-for-S_IFDIR.patch
0c4011b685a1e8d535af123cbaf79ab53d59ea665ca5350ab1077ad4e962b49c1fd5b1b5bb3f28c3e28145dfd02aa83023f78de5edec15afe84e3e06e742a67c  systemd-251.2.tar.gz
f076304ea23382099c6b96b2f839f5e5b1e5847af3165f2a468fd5f9db605aa12a0a92ed565cefce58a9323eb8b9cac3a823cd2f55523b913bb8fb4fc6d84dff  0001-Adjust-for-musl-headers.patch
ac874fd9352460005d0a4b5aec04b92943d7a16621946e240eff56e74fc4b15924179889950d8c4b94f541ad7df6d2b670d5a407e2e52b05b3ea2c2464bc4efb  0001-pass-correct-parameters-to-getdents64.patch
fba959ab24acead001efe812b0fd64b62be805347050ce997e7ba38c6aae74b9968f88883ec5f7886e38dbd8f4e04c130e726a192bac06d685fb7a2ff9be2a14  0002-Add-sys-stat.h-for-S_IFDIR.patch
2d64820616f8e90a36db93b8e4d070a3ebb14f30c479bf3d91657ee813dde540dc6de8d416d934835b8845f03fb87004e1004eaf9c31a006abd7114ec9156010  0003-missing_type.h-add-comparison_fn_t.patch
daf40f1047105e796a3840a8b02027f8f1e22d6f36b1776e24c62cbd32941641f33a7d4ce95d884acd01d959ad1c8e92e8a463ac68537e5e9428d238c9e00efe  0004-add-fallback-parse_printf_format-implementation.patch
c75049f847828997b401ff964b9efa551c5418ab7142c8d482c16685b358c003f0980f2959e46da13853b7eb4fb8cad81f7ac5f894fc637fd53de6c77358c06f  0005-src-basic-missing.h-check-for-missing-strndupa.patch
2fb8f3d17bcdecc0ecc7fdbce7ce7c77d02dd34df34530b1cf1a24431aff382fb683782d6eb960ea4a88ca96fdf006ea42dfe03dd659d8efcfbb757996413786  0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
9566e079d6f19062210bffbb11246e44e1c3cb6696d1507a99c5aa3abbdaf556bf0cc5ee47172b76c218278fbbe3780b1d93333aa232a8082ba11faf32019d08  0008-add-missing-FTW_-macros-for-musl.patch
da4439142a9b7489baffcf9dfdf1632e056437e2575974944cac7795f63086b55221e65183dc41ad3d0745d12345178a99ae8cad2646de24a7d157921add2b01  0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch
b9060f1221ae3486b5a70ab76c9e34b428daa493ff956327cb7a1ba3123a19c0c8e55a45f19f7eca2595dca1e71567a2792289f45728ccca8f4c93cb436746e6  0010-Use-uintmax_t-for-handling-rlim_t.patch
73a526913021b775dbb86df307c3cc1218155fc3fbd84826d32f3836575bb5b7f2ffed0b662fe0e113d7e3b5820a200045228a18c7433ad5e0f0ea969a2974c6  0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
46214b7edc2a8c20066279877689f41fa707ca22f20583727a12fbc9749ff3235244199afdc2ed41705d8fc8b53e5400a83bf28938c296ed42098843783b1a84  0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
605502db16e775bfa7d029b0694f25b8f4f3cbfd0d1c7f1ef8247299d5a63ee337270d1d38a1378ecdbb57c7f153e40a3dede820aef505a9471857b9caedf556  0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
5388555fa8b84834bd051b8adae6c0a73eb8607dc2c88e5f697e6592a7d1c92b8feade49e14cd00040a16cf487481d58b8972bd4eb0a7ae419cccc5c75cd3034  0018-avoid-redefinition-of-prctl_mm_map-structure.patch
c3a5a880f94630696cd0d6343c3acd7f2870707f284c2649d6b94ed96dc9ae951cfbb83d3b552dba39707ffc48a0d6b0170c3b47970b5486a21887cec1afdc5b  0021-test-json.c-define-M_PIl.patch
9836c441c897a7f5fee1cb8cc74d68dd66feb2b2d0fb1d1afadd4ddd229f6504932b36d467031f28065970958afb5a1cb2c3dc658cbaf7d103fd1dfe61197702  0022-do-not-disable-buffer-in-writing-files.patch
8aa96a16ced368c25e88e074a0a5477f10f10d0383018636c3f5f65e2b4e4758d16fb2135d75487f162b47ea63ff2b95258f010a960a9c7665a08bd4973bc155  0025-Handle-__cpu_mask-usage.patch
ee54ebe4a0e23bfa1738d38467f22ff022399dfb6a2fcb2e61e7c2c66a6839bb7a9bf8fd7dc2d1a187495b8983c887543cb77bec142d8abed79e7f25820d537b  0026-Handle-missing-gshadow.patch
830289b7217900ad7ff82c28222919eb1c274389dc906e45b276cb18fec5e73b89529a005265f1850fdb02206985c46f8eb11c998a6b02532455d3f4bec4c114  0004-add-fallback-parse_printf_format-implementation.patch
7e17840b8da71679ee15d22435183dda045d58b450dbcaf917e3acb2c7ef03d9a1e4d27570b6112dc00e28c254a8c49863b76b815957568c9b419f3d6ec1fac6  0005-src-basic-missing.h-check-for-missing-strndupa.patch
c622a3f201c83877c80441e6f38b3ac43ef231003dfc214294bb25c7fc857d539a6f97558e9f871d86e43783f5c78f948bd6049d8d46d06d148a7430f3e6f853  0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
a34206eec8fc97eb3469a13b4531cee3c9e2ed170954e748db4dc53643c641b69dfede4c4ce36f440040beb36f6e091f01116335117be82353c94af8e5f8cd1f  0008-add-missing-FTW_-macros-for-musl.patch
f3046a588b0c7f1cb995f31819f6ebb0fa8da9a442fbf267a8817ead85772e99d4140773a299f17e6819e44c43034e3c13ec4e8a6941dcde824ce7aa868829f9  0010-Use-uintmax_t-for-handling-rlim_t.patch
0f02d7fd4c92bc94e616837aac25a7c06ebff1b45e3f726cf4cd0d07db670a2502cb4345304d4c47b99024d75220c3df2c8a8c94ba1d769ecbb2ebf247ef10de  0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
4bee7f5a5f517b0f3d906636d45d1a2db733a749dfd1c9b03d0ac033c3bde83e669c7ffe8f7d3b43def9a2f495231efa6d7caa93ea71ad4d577721a08ee80ebe  0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
e1eb4645580aeaab05c87589229d3692addff42ff132a6b5b1928b3d05280f2fce5b9f0adb2b0587fe56f75d47c5a7e83797a9b6e650ee94fd0173c28c6d6fb2  0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
6556a44bf013cfa37b68faec39387907bcb601f316bc056b99b8bb26c15ff373f2214fce343aa44401981837c7401bc4c5aa564d3f4321277bdd65f2e4ba5228  0018-avoid-redefinition-of-prctl_mm_map-structure.patch
9526aac2ccfa239a3fd22dcbc87b3a838ce391c84bb5ffb8d6ff2a221ac59584227ff6438906a44a81ebab74fbe53021dc208a7385906d5105d8b4d620fa60b2  0022-do-not-disable-buffer-in-writing-files.patch
5b07b3375846ac09102391a1631c98ea5f75b8a62bf70e589b7d66813a088d397f10ffc493ba0d7365b6a315ae54e4db2a00819ad11d40341f4a3925a00b624b  0025-Handle-__cpu_mask-usage.patch
1e3f85276fa22b0262220291833125907d13e3f7610fc9a38eb5e26eece532fc9f016bb73d12475d88a0bffbb9bc33c79d6ad94e85a0b167bafc9f5ecacac7ab  0026-Handle-missing-gshadow.patch
aeca4851d4cef2439eca2519dd031a842d7699782edee06239ca66f157711faf16c2943b310963faaf06d3b8c02bb0390b900ea8900c88e5ecbfc000f7929ab6  0100-Do-not-buffer-on-systemd-sleep.patch
7e2d8dd17dff530218ab6301d718d47264688ec7c4de0f57004b2a7b512f26a4ff1ab962b74f8914e410b9cc03ccf304822c5cf67b5b64fe584dc884e68fcb9e  0101-efi-do-not-set-wide-exec-charset.patch
fe38ef55e7c164994d599238d3d896ee4b1c6373e4a8d84ee4a2d29c59707ad872d69c3e35ecba85c46515cef94b1ab415bf4f8867f4eff290788e16255025f0  0102-test-resolved-stream-explicit-cast-sockaddr_in-point.patch
"