Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - Software
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
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC TDC 1ns 5cha - Software
Commits
b7de3eb5
Commit
b7de3eb5
authored
Nov 18, 2013
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: fix wrong number of FDs for select() call
parent
097d22f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
fmctdc-read.c
test/fmctdc-read.c
+7
-3
No files found.
test/fmctdc-read.c
View file @
b7de3eb5
...
...
@@ -102,6 +102,7 @@ int main(int argc, char **argv)
n
=
0
;
while
(
!
stop
)
{
int
nfds
=
0
;
struct
fmctdc_time
ts
;
stop
=
1
;
...
...
@@ -109,17 +110,20 @@ int main(int argc, char **argv)
for
(
i
=
FMCTDC_CH_1
;
i
<=
FMCTDC_CH_LAST
;
i
++
)
{
int
fd
=
channels
[
i
-
FMCTDC_CH_1
];
if
(
fd
<
0
)
{
fprintf
(
stderr
,
"Can't open channel %d
\n
"
,
i
);
return
-
1
;
}
else
if
(
fd
>
0
)
}
else
if
(
fd
>
0
)
{
FD_SET
(
fd
,
&
rfds
);
nfds
=
fd
>
nfds
?
fd
:
nfds
;
}
}
/* non-blocking mode: do nothing, otherwise wait until one of the channels becomes active */
if
(
!
non_block
&&
select
(
FMCTDC_NUM_CHANNELS
+
1
,
&
rfds
,
NULL
,
NULL
,
NULL
)
<=
0
)
&&
select
(
nfds
+
1
,
&
rfds
,
NULL
,
NULL
,
NULL
)
<=
0
)
continue
;
for
(
i
=
FMCTDC_CH_1
;
i
<=
FMCTDC_CH_LAST
;
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