Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
4092eb41
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4092eb41
编写于
6月 23, 2008
作者:
A
anthony
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6704896: FD_SET usage can cause stack corruption (sol)
Summary: Using poll() instead of select() Reviewed-by: yan, denis
上级
324030df
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
20 deletion
+15
-20
src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c
src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c
+15
-20
未找到文件。
src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c
浏览文件 @
4092eb41
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#include <langinfo.h>
#include <langinfo.h>
#include <locale.h>
#include <locale.h>
#include <fcntl.h>
#include <fcntl.h>
#include <poll.h>
static
Bool
shapeSupported
;
static
Bool
shapeSupported
;
static
int
shapeEventBase
,
shapeErrorBase
;
static
int
shapeEventBase
,
shapeErrorBase
;
...
@@ -534,40 +535,34 @@ void
...
@@ -534,40 +535,34 @@ void
SplashEventLoop
(
Splash
*
splash
)
{
SplashEventLoop
(
Splash
*
splash
)
{
/* Different from win32 implementation - this loop
/* Different from win32 implementation - this loop
uses
select
timeouts instead of a timer */
uses
poll
timeouts instead of a timer */
/* we should have splash _locked_ on entry!!! */
/* we should have splash _locked_ on entry!!! */
int
xconn
=
XConnectionNumber
(
splash
->
display
);
int
xconn
=
XConnectionNumber
(
splash
->
display
);
while
(
1
)
{
while
(
1
)
{
struct
pollfd
pfd
[
2
];
int
timeout
=
-
1
;
int
ctl
=
splash
->
controlpipe
[
0
];
int
ctl
=
splash
->
controlpipe
[
0
];
fd_set
fds
[
2
];
int
n
=
0
;
struct
timeval
tv
,
*
ptv
;
int
rc
;
int
rc
;
int
time
;
int
pipes_empty
;
int
pipes_empty
;
FD_ZERO
(
fds
);
pfd
[
0
].
fd
=
xconn
;
FD_SET
(
xconn
,
fds
);
pfd
[
0
].
events
=
POLLIN
|
POLLPRI
;
if
(
xconn
+
1
>
n
)
n
=
xconn
+
1
;
pfd
[
1
].
fd
=
ctl
;
FD_SET
(
ctl
,
fds
);
pfd
[
1
].
events
=
POLLIN
|
POLLPRI
;
if
(
ctl
+
1
>
n
)
n
=
ctl
+
1
;
errno
=
0
;
errno
=
0
;
if
(
splash
->
isVisible
>
0
&&
SplashIsStillLooping
(
splash
))
{
if
(
splash
->
isVisible
>
0
&&
SplashIsStillLooping
(
splash
))
{
time
=
splash
->
time
+
splash
->
frames
[
splash
->
currentFrame
].
delay
time
out
=
splash
->
time
+
splash
->
frames
[
splash
->
currentFrame
].
delay
-
SplashTime
();
-
SplashTime
();
if
(
time
<
0
)
if
(
timeout
<
0
)
{
time
=
0
;
timeout
=
0
;
msec2timeval
(
time
,
&
tv
);
}
ptv
=
&
tv
;
}
else
{
ptv
=
NULL
;
}
}
SplashUnlock
(
splash
);
SplashUnlock
(
splash
);
rc
=
select
(
n
,
fds
,
NULL
,
NULL
,
ptv
);
rc
=
poll
(
pfd
,
2
,
timeout
);
SplashLock
(
splash
);
SplashLock
(
splash
);
if
(
splash
->
isVisible
>
0
&&
SplashTime
()
>=
splash
->
time
+
if
(
splash
->
isVisible
>
0
&&
SplashTime
()
>=
splash
->
time
+
splash
->
frames
[
splash
->
currentFrame
].
delay
)
{
splash
->
frames
[
splash
->
currentFrame
].
delay
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录