Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a5ef7ce0
Commit
a5ef7ce0
authored
Feb 12, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use poll() always and fix terrible bug due to #ifdefs
parent
1c3bc897
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
32 deletions
+1
-32
src/network/io.c
src/network/io.c
+1
-32
No files found.
src/network/io.c
View file @
a5ef7ce0
...
...
@@ -286,12 +286,7 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
{
unsigned
i
;
ssize_t
n
;
#ifdef HAVE_POLL
struct
pollfd
ufd
[
fdc
];
#else
int
maxfd
=
-
1
;
fd_set
set
;
#endif
int
delay_ms
=
500
;
if
((
wait_ms
!=
-
1
)
&&
(
wait_ms
<
500
))
...
...
@@ -303,7 +298,6 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
goto
error
;
}
#ifdef HAVE_POLL
memset
(
ufd
,
0
,
sizeof
(
ufd
));
for
(
i
=
0
;
i
<
fdc
;
i
++
)
...
...
@@ -313,28 +307,6 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
}
n
=
poll
(
ufd
,
fdc
,
delay_ms
);
#else
FD_ZERO
(
&
set
);
for
(
i
=
0
;
i
<
fdc
;
i
++
)
{
#if !defined(WIN32) && !defined(UNDER_CE)
if
(
fdv
[
i
]
>=
FD_SETSIZE
)
{
/* We don't want to overflow select() fd_set */
msg_Err
(
p_this
,
"select set overflow"
);
return
-
1
;
}
#endif
FD_SET
(
fdv
[
i
],
&
set
);
if
(
fdv
[
i
]
>
maxfd
)
maxfd
=
fdv
[
i
];
}
n
=
select
(
maxfd
+
1
,
&
set
,
NULL
,
NULL
,
(
wait_ms
==
-
1
)
?
NULL
:
&
(
struct
timeval
){
0
,
delay_ms
*
1000
}
);
#endif
if
(
n
==
-
1
)
goto
error
;
...
...
@@ -345,15 +317,12 @@ net_ReadInner( vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
for
(
i
=
0
;;
i
++
)
{
#ifdef HAVE_POLL
if
((
i_total
>
0
)
&&
(
ufd
[
i
].
revents
&
POLLERR
))
return
i_total
;
// error will be dequeued on next run
if
((
ufd
[
i
].
revents
&
POLLIN
)
==
0
)
#else
if
(
!
FD_ISSET
(
fdv
[
i
],
&
set
))
continue
;
#endif
fdc
=
1
;
fdv
+=
i
;
vsv
+=
i
;
...
...
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