1 Star 0 Fork 21

王歌/erlang

forked from src-openEuler/erlang 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
otp-0011-configure.ac-C99-fixes-for-poll_works-check.patch 1.81 KB
一键复制 编辑 原始数据 按行查看 历史
wk333 提交于 2023-09-18 10:26 +08:00 . Update to 25.3.2.6
From: Florian Weimer <fweimer@redhat.com>
Date: Thu, 24 Nov 2022 11:59:22 +0100
Subject: [PATCH] configure.ac: C99 fixes for poll_works check
Include <fcntl.h> if it is available for the open prototype.
Return from main instead of calling exit, so that no function
declaration is needed.
diff --git a/erts/configure b/erts/configure
index 46e882e99a..7cc6f802ce 100755
--- a/erts/configure
+++ b/erts/configure
@@ -24575,10 +24575,13 @@ else $as_nop
/* end confdefs.h. */
#include <poll.h>
-main()
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+int main()
{
#ifdef _POLL_EMUL_H_
- exit(1); /* Implemented using select() -- fail */
+ return 1; /* Implemented using select() -- fail */
#else
struct pollfd fds[1];
int fd;
@@ -24587,9 +24590,9 @@ main()
fds[0].events = POLLIN;
fds[0].revents = 0;
if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
- exit(1); /* Does not work for devices -- fail */
+ return 1; /* Does not work for devices -- fail */
}
- exit(0);
+ return 0;
#endif
}
diff --git a/erts/configure.ac b/erts/configure.ac
index 316345079b..439ec5d4a1 100644
--- a/erts/configure.ac
+++ b/erts/configure.ac
@@ -3055,10 +3055,13 @@ poll_works=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <poll.h>
-main()
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+int main()
{
#ifdef _POLL_EMUL_H_
- exit(1); /* Implemented using select() -- fail */
+ return 1; /* Implemented using select() -- fail */
#else
struct pollfd fds[1];
int fd;
@@ -3067,9 +3070,9 @@ main()
fds[0].events = POLLIN;
fds[0].revents = 0;
if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
- exit(1); /* Does not work for devices -- fail */
+ return 1; /* Does not work for devices -- fail */
}
- exit(0);
+ return 0;
#endif
}
]])],[poll_works=yes],[poll_works=no],[
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wang--ge/erlang.git
git@gitee.com:wang--ge/erlang.git
wang--ge
erlang
erlang
master

搜索帮助