Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-camogm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-camogm
Commits
173e7331
Commit
173e7331
authored
May 19, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check command pipe file before unlink
parent
4567a7bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
camogm.c
camogm.c
+3
-2
No files found.
camogm.c
View file @
173e7331
...
@@ -1328,7 +1328,7 @@ void clean_up(camogm_state *state)
...
@@ -1328,7 +1328,7 @@ void clean_up(camogm_state *state)
int
listener_loop
(
camogm_state
*
state
)
int
listener_loop
(
camogm_state
*
state
)
{
{
FILE
*
cmd_file
;
FILE
*
cmd_file
;
int
rslt
,
ret
,
cmd
;
int
rslt
,
ret
,
cmd
,
f_ok
;
int
fp0
,
fp1
;
int
fp0
,
fp1
;
int
process
=
1
;
int
process
=
1
;
unsigned
int
port
=
state
->
port_num
;
unsigned
int
port
=
state
->
port_num
;
...
@@ -1397,8 +1397,9 @@ int listener_loop(camogm_state *state)
...
@@ -1397,8 +1397,9 @@ int listener_loop(camogm_state *state)
// create a named pipe
// create a named pipe
// always delete the pipe if it existed, start a fresh one
// always delete the pipe if it existed, start a fresh one
f_ok
=
access
(
pipe_name
,
F_OK
);
ret
=
unlink
(
pipe_name
);
ret
=
unlink
(
pipe_name
);
if
(
ret
)
{
if
(
ret
&&
f_ok
==
0
)
{
D1
(
fprintf
(
debug_file
,
"Unlink %s returned %d, errno=%d
\n
"
,
pipe_name
,
ret
,
errno
));
D1
(
fprintf
(
debug_file
,
"Unlink %s returned %d, errno=%d
\n
"
,
pipe_name
,
ret
,
errno
));
}
}
ret
=
mkfifo
(
pipe_name
,
0777
);
//EEXIST
ret
=
mkfifo
(
pipe_name
,
0777
);
//EEXIST
...
...
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