Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
47
Issues
47
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
a14ec0c0
Commit
a14ec0c0
authored
Dec 06, 2016
by
Grzegorz Daniluk
Committed by
Adam Wujek
Dec 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-wrs: start only if there is no other PPSi already running
Otherwise it breaks Minipc and wr_mon cannot start.
parent
12514c7c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
wrs-startup.c
arch-wrs/wrs-startup.c
+19
-0
No files found.
arch-wrs/wrs-startup.c
View file @
a14ec0c0
...
...
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <sys/timex.h>
#include <signal.h>
#include <minipc.h>
#include <hal_exports.h>
...
...
@@ -86,6 +87,24 @@ int main(int argc, char **argv)
pp_printf
(
"PPSi. Commit %s, built on "
__DATE__
"
\n
"
,
PPSI_VERSION
);
/* check if there is another instance of PPSi already running */
ppsi_head
=
wrs_shm_get
(
wrs_shm_ptp
,
""
,
WRS_SHM_READ
);
if
(
!
ppsi_head
)
{
pp_printf
(
"Unable to open shm for PPSi! Unable to check if "
"there is another PPSi instance running. Error: %s
\n
"
,
strerror
(
errno
));
exit
(
1
);
}
/* check if pid is 0 (shm not filled) or process with provided
* pid does not exist (probably crashed) */
if
((
ppsi_head
->
pid
!=
0
)
&&
(
kill
(
ppsi_head
->
pid
,
0
)
==
0
))
{
wrs_shm_put
(
ppsi_head
);
pp_printf
(
"Fatal: There is another PPSi instance running. "
"Exit...
\n\n
"
);
exit
(
1
);
}
/* try connecting to HAL multiple times in case it's still not ready */
hal_retries
=
WRSW_HAL_RETRIES
;
while
(
hal_retries
)
{
/* may be never, if built without WR extension */
...
...
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