File 0613-kernel-os_SUITE-fix-close_stdin-test.patch of Package erlang

From 2b3f8cc51362eaf87a00d427bb67065a3373d566 Mon Sep 17 00:00:00 2001
From: Matthew Smith <matthew@gentoo.org>
Date: Sat, 3 Dec 2022 10:06:49 +0000
Subject: [PATCH] kernel: os_SUITE: fix close_stdin test

* os_SUITE_data/my_fds.c:
  read(stdin, buff, 1) is invalid because stdin is a FILE* and not an
  fd, will become an error by default in clang 16.
* os_SUITE.erl:
  my_fds program now returns 0 bytes read instead of -1 for error,
  update assertion.
---
 lib/kernel/test/os_SUITE.erl           | 2 +-
 lib/kernel/test/os_SUITE_data/my_fds.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index fbae6892f6..cf166d6e39 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -337,7 +337,7 @@ close_stdin(Config) ->
     DataDir = proplists:get_value(data_dir, Config),
     Fds = filename:join(DataDir, "my_fds"),
 
-    "-1" = os:cmd(Fds).
+    "0" = os:cmd(Fds).
 
 max_size_command(_Config) ->
     WSL = case os:getenv("WSLENV") of
diff --git a/lib/kernel/test/os_SUITE_data/my_fds.c b/lib/kernel/test/os_SUITE_data/my_fds.c
index 8b1ce13822..9b51db514e 100644
--- a/lib/kernel/test/os_SUITE_data/my_fds.c
+++ b/lib/kernel/test/os_SUITE_data/my_fds.c
@@ -8,6 +8,6 @@ int
 main(int argc, char** argv)
 {
     char buff[1];
-    int res = read(stdin, buff, 1);
+    int res = read(STDIN_FILENO, buff, 1);
     printf("%d", res);
 }
-- 
2.35.3

openSUSE Build Service is sponsored by