Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a4dd6a6a
Commit
a4dd6a6a
authored
Apr 25, 1999
by
David Luyer
Committed by
Alexandre Julliard
Apr 25, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- consolidate both cases of !pending in WaitNetEvent
- select() returns -1 not 0 on error in WaitNetEvent
parent
2d127437
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
31 deletions
+23
-31
event.c
windows/x11drv/event.c
+23
-31
No files found.
windows/x11drv/event.c
View file @
a4dd6a6a
...
...
@@ -212,7 +212,7 @@ BOOL X11DRV_EVENT_WaitNetEvent( BOOL sleep, BOOL peek )
* in this case, we fall through directly to the XNextEvent loop.
*/
if
(
(
maxWait
!=
-
1
)
&&
!
pending
)
if
(
!
pending
)
{
int
num_pending
;
struct
timeval
timeout
;
...
...
@@ -220,8 +220,10 @@ BOOL X11DRV_EVENT_WaitNetEvent( BOOL sleep, BOOL peek )
memcpy
(
io_set
,
__event_io_set
,
sizeof
(
io_set
)
);
timeout
.
tv_usec
=
(
maxWait
%
1000
)
*
1000
;
timeout
.
tv_sec
=
maxWait
/
1000
;
if
(
maxWait
!=
-
1
)
{
timeout
.
tv_usec
=
(
maxWait
%
1000
)
*
1000
;
timeout
.
tv_sec
=
maxWait
/
1000
;
}
#ifdef CONFIG_IPC
sigsetjmp
(
env_wait_x
,
1
);
...
...
@@ -236,23 +238,35 @@ BOOL X11DRV_EVENT_WaitNetEvent( BOOL sleep, BOOL peek )
/* The code up to the next "stop_wait_op = CONT" must be reentrant */
num_pending
=
select
(
__event_max_fd
,
&
io_set
[
EVENT_IO_READ
],
&
io_set
[
EVENT_IO_WRITE
],
&
io_set
[
EVENT_IO_EXCEPT
],
&
timeout
);
&
io_set
[
EVENT_IO_EXCEPT
],
(
maxWait
==
-
1
)
?
0
:
&
timeout
);
if
(
num_pending
==
-
1
)
{
/* Error - signal, invalid arguments, out of memory */
stop_wait_op
=
CONT
;
return
FALSE
;
}
if
(
num_pending
==
0
)
{
/* Timeout */
stop_wait_op
=
CONT
;
TIMER_ExpireTimers
();
TIMER_ExpireTimers
();
/* FIXME: should this be done even if sleep == 0? */
return
FALSE
;
}
else
stop_wait_op
=
CONT
;
#else
/* CONFIG_IPC */
num_pending
=
select
(
__event_max_fd
,
&
io_set
[
EVENT_IO_READ
],
&
io_set
[
EVENT_IO_WRITE
],
&
io_set
[
EVENT_IO_EXCEPT
],
&
timeout
);
&
io_set
[
EVENT_IO_EXCEPT
],
(
maxWait
==
-
1
)
?
0
:
&
timeout
);
if
(
num_pending
==
0
)
if
(
num_pending
==
-
1
)
{
/* Error - signal, invalid arguments, out of memory */
return
FALSE
;
}
if
(
num_pending
==
0
)
{
/* Timeout
or error
*/
TIMER_ExpireTimers
();
/* Timeout */
TIMER_ExpireTimers
();
/* FIXME: should this be done even if sleep == 0? */
return
FALSE
;
}
#endif
/* CONFIG_IPC */
...
...
@@ -279,28 +293,6 @@ BOOL X11DRV_EVENT_WaitNetEvent( BOOL sleep, BOOL peek )
return
FALSE
;
}
}
else
if
(
!
pending
)
{
/* Wait for X11 input. */
fd_set
set
;
int
max_fd
;
FD_ZERO
(
&
set
);
FD_SET
(
__event_x_connection
,
&
set
);
/* wait on wake-up pipe also */
FD_SET
(
__wakeup_pipe
[
0
],
&
set
);
if
(
__event_x_connection
>
__wakeup_pipe
[
0
])
max_fd
=
__event_x_connection
+
1
;
else
max_fd
=
__wakeup_pipe
[
0
]
+
1
;
select
(
max_fd
,
&
set
,
0
,
0
,
0
);
/* Flush the wake-up pipe, it's just dummy data for waking-up this
thread. This will be obsolete when the input thread will be done */
if
(
FD_ISSET
(
__wakeup_pipe
[
0
],
&
set
)
)
EVENT_ReadWakeUpPipe
();
}
/* Process current X event (and possibly others that occurred in the meantime) */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment