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
50
Issues
50
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
81c726be
Commit
81c726be
authored
Jan 22, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugged timer handling (caused seg faults)
parent
87e9c057
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
posix-timer.c
arch-gnu-linux/posix-timer.c
+7
-5
No files found.
arch-gnu-linux/posix-timer.c
View file @
81c726be
...
...
@@ -43,7 +43,9 @@ int posix_timer_init(struct pp_instance *ppi)
int
posix_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
)
{
time
((
time_t
*
)
&
tm
->
start
);
time_t
now
;
now
=
time
(
NULL
);
tm
->
start
=
(
uint32_t
)
now
;
tm
->
interval
=
interval
;
return
0
;
...
...
@@ -59,16 +61,16 @@ int posix_timer_stop(struct pp_timer *tm)
int
posix_timer_expired
(
struct
pp_timer
*
tm
)
{
uint32
_t
now
;
time
_t
now
;
if
(
tm
->
start
==
0
)
{
PP_PRINTF
(
"
Warning: posix_timer_expired: timer not started
\n
"
);
PP_PRINTF
(
"
%p Warning: posix_timer_expired: timer not started
\n
"
,
tm
);
return
0
;
}
time
((
time_t
*
)
&
now
);
now
=
time
(
NULL
);
if
(
tm
->
start
+
tm
->
interval
<
now
)
if
(
tm
->
start
+
tm
->
interval
<
(
uint32_t
)
now
)
return
1
;
return
0
;
...
...
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