From 5a4334fde21b896cd75b2d1a56e06a4f365e9c4d Mon Sep 17 00:00:00 2001
From: Chen Qi <Qi.Chen@windriver.com>
Date: Tue, 2 Jul 2024 22:44:31 -0700
Subject: [PATCH 24/26] undef stdin for references using stdin as a struct
 member

In musl stdio.h, we have:
include/stdio.h:#define stdin  (stdin)

This causes error when a struct member is also named stdin. undef it.

Upstream-Status: Inappropriate [musl specific]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 src/shared/edit-util.c         | 2 ++
 src/systemctl/systemctl-edit.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/shared/edit-util.c b/src/shared/edit-util.c
index e37609c2e1..1b212ae7b4 100644
--- a/src/shared/edit-util.c
+++ b/src/shared/edit-util.c
@@ -3,6 +3,8 @@
 #include <errno.h>
 #include <stdio.h>
 
+#undef stdin
+
 #include "alloc-util.h"
 #include "copy.h"
 #include "edit-util.h"
diff --git a/src/systemctl/systemctl-edit.c b/src/systemctl/systemctl-edit.c
index c42a31153d..7695ceeead 100644
--- a/src/systemctl/systemctl-edit.c
+++ b/src/systemctl/systemctl-edit.c
@@ -13,6 +13,8 @@
 #include "systemctl.h"
 #include "terminal-util.h"
 
+#undef stdin
+
 int verb_cat(int argc, char *argv[], void *userdata) {
         _cleanup_hashmap_free_ Hashmap *cached_id_map = NULL, *cached_name_map = NULL;
         _cleanup_(lookup_paths_done) LookupPaths lp = {};
-- 
2.34.1

