Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
8bda7d72
Commit
8bda7d72
authored
Nov 09, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix previous commit (untested)
parent
acade544
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
30 deletions
+40
-30
src/network/poll.c
src/network/poll.c
+40
-30
No files found.
src/network/poll.c
View file @
8bda7d72
...
@@ -46,6 +46,8 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
...
@@ -46,6 +46,8 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
WSAEVENT
phEvents
[
nfds
];
WSAEVENT
phEvents
[
nfds
];
DWORD
val
;
DWORD
val
;
vlc_testcancel
();
for
(
unsigned
i
=
0
;
i
<
nfds
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
nfds
;
i
++
)
{
{
long
events
=
FD_CLOSE
;
long
events
=
FD_CLOSE
;
...
@@ -62,44 +64,52 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
...
@@ -62,44 +64,52 @@ int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
WSAEventSelect
(
fds
[
i
].
fd
,
phEvents
[
i
],
events
);
WSAEventSelect
(
fds
[
i
].
fd
,
phEvents
[
i
],
events
);
}
}
int
ret
=
0
,
n
;
switch
(
WaitForMultipleObjectsEx
(
nfds
,
phEvents
,
FALSE
,
timeout
,
TRUE
))
switch
(
WaitForMultipleObjectsEx
(
nfds
,
phEvents
,
FALSE
,
timeout
,
TRUE
))
{
{
case
WAIT_IO_COMPLETION
:
case
WAIT_IO_COMPLETION
:
WSASetLastError
(
WSAEINTR
);
WSASetLastError
(
WSAEINTR
);
return
-
1
;
ret
=
-
1
;
break
;
case
WAIT_TIMEOUT
:
case
WAIT_TIMEOUT
:
return
0
;
ret
=
0
;
break
;
default:
for
(
unsigned
i
=
0
;
i
<
nfds
;
i
++
)
{
WSANETWORKEVENTS
events
;
if
(
WSAEnumNetworkEvents
(
fds
[
i
].
fd
,
phEvents
[
i
],
&
events
))
{
fds
[
i
].
revents
|=
POLLNVAL
;
ret
=
-
1
;
continue
;
}
if
(
events
.
lNetworkEvents
&
FD_CLOSE
)
fds
[
i
].
revents
|=
POLLHUP
|
(
fds
[
i
].
events
&
POLLIN
);
if
(
events
.
lNetworkEvents
&
FD_ACCEPT
)
fds
[
i
].
revents
|=
POLLIN
;
if
(
events
.
lNetworkEvents
&
FD_OOB
)
fds
[
i
].
revents
|=
POLLPRI
;
if
(
events
.
lNetworkEvents
&
FD_READ
)
fds
[
i
].
revents
|=
POLLIN
;
if
(
events
.
lNetworkEvents
&
FD_WRITE
)
{
fds
[
i
].
revents
|=
POLLOUT
;
if
(
events
.
iErrorCode
[
FD_WRITE_BIT
])
fds
[
i
].
revents
|=
POLLERR
;
}
if
(
fds
[
i
].
events
)
n
++
;
}
if
(
ret
==
0
)
ret
=
n
;
}
}
int
n
=
0
,
err
=
0
;
for
(
unsigned
i
=
0
;
i
<
nfds
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
nfds
;
i
++
)
{
WSANETWORKEVENTS
events
;
err
=
WSAEnumNetworkEvents
(
fds
[
i
].
fd
,
phEvents
[
i
],
&
events
);
WSACloseEvent
(
phEvents
[
i
]);
WSACloseEvent
(
phEvents
[
i
]);
if
(
err
)
vlc_testcancel
();
{
fds
[
i
].
revents
|=
POLLNVAL
;
return
ret
;
continue
;
}
if
(
events
.
lNetworkEvents
&
FD_CLOSE
)
fds
[
i
].
revents
|=
POLLHUP
|
(
fds
[
i
].
events
&
POLLIN
);
if
(
events
.
lNetworkEvents
&
FD_ACCEPT
)
fds
[
i
].
revents
|=
POLLIN
;
if
(
events
.
lNetworkEvents
&
FD_OOB
)
fds
[
i
].
revents
|=
POLLPRI
;
if
(
events
.
lNetworkEvents
&
FD_READ
)
fds
[
i
].
revents
|=
POLLIN
;
if
(
events
.
lNetworkEvents
&
FD_WRITE
)
{
fds
[
i
].
revents
|=
POLLOUT
;
if
(
events
.
iErrorCode
[
FD_WRITE_BIT
])
fds
[
i
].
revents
|=
POLLERR
;
}
if
(
fds
[
i
].
events
)
n
++
;
}
return
err
?
-
1
:
n
;
}
}
#endif
/* WIN32 */
#endif
/* WIN32 */
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