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
36ba6777
Commit
36ba6777
authored
Feb 17, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: fix errno usage
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
f4269424
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
fmctdc-lib.c
lib/fmctdc-lib.c
+16
-9
No files found.
lib/fmctdc-lib.c
View file @
36ba6777
...
...
@@ -290,8 +290,10 @@ int fmctdc_set_termination(struct fmctdc_board *userb, unsigned int channel,
uint32_t
val
;
char
attr
[
32
];
if
(
channel
>=
FMCTDC_NUM_CHANNELS
)
return
-
EINVAL
;
if
(
channel
>=
FMCTDC_NUM_CHANNELS
)
{
errno
=
EINVAL
;
return
-
1
;
}
snprintf
(
attr
,
sizeof
(
attr
),
"ft-ch%d/termination"
,
channel
+
1
);
...
...
@@ -315,8 +317,10 @@ int fmctdc_get_termination(struct fmctdc_board *userb, unsigned int channel)
char
attr
[
32
];
int
ret
;
if
(
channel
>=
FMCTDC_NUM_CHANNELS
)
return
-
EINVAL
;
if
(
channel
>=
FMCTDC_NUM_CHANNELS
)
{
errno
=
EINVAL
;
return
-
1
;
}
snprintf
(
attr
,
sizeof
(
attr
),
"ft-ch%d/termination"
,
channel
+
1
);
...
...
@@ -438,8 +442,10 @@ int fmctdc_read(struct fmctdc_board *userb, unsigned int channel,
int
i
,
j
,
fd
;
fd_set
set
;
if
(
channel
>=
FMCTDC_NUM_CHANNELS
)
return
-
EINVAL
;
if
(
channel
>=
FMCTDC_NUM_CHANNELS
)
{
errno
=
EINVAL
;
return
-
1
;
}
fd
=
__fmctdc_open_channel
(
b
,
channel
);
if
(
fd
<
0
)
...
...
@@ -594,8 +600,9 @@ int fmctdc_wr_mode(struct fmctdc_board *userb, int on)
/**
* It check the current status of the WhiteRabbit timing system on a TDC device
* @param[in] userb TDC board instance token
* @return 0 if it properly works, -ENOLINK if it is not synchronized and
* -ENODEV if it is not enabled
* @return 0 if it properly works, -1 on error and errno is set appropriately.
* - ENOLINK if it is not synchronized and
* - ENODEV if it is not enabled
*/
extern
int
fmctdc_check_wr_mode
(
struct
fmctdc_board
*
userb
)
{
...
...
@@ -603,7 +610,7 @@ extern int fmctdc_check_wr_mode(struct fmctdc_board *userb)
if
(
__fmctdc_command
(
b
,
FT_CMD_WR_QUERY
)
==
0
)
return
0
;
return
errno
;
return
-
1
;
}
...
...
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