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
e5f91a7f
Commit
e5f91a7f
authored
Aug 29, 2017
by
Sven Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time-unix: bit mask for leap flags
parent
11bd0278
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
unix-time.c
time-unix/unix-time.c
+7
-4
No files found.
time-unix/unix-time.c
View file @
e5f91a7f
...
...
@@ -61,10 +61,10 @@ static int unix_time_get_utc_offset(struct pp_instance *ppi, int *offset, int *l
memset
(
&
t
,
0
,
sizeof
(
t
));
ret
=
adjtimex
(
&
t
);
if
(
ret
>=
0
)
{
if
(
t
.
status
==
STA_INS
)
{
if
(
(
t
.
status
&
STA_INS
)
==
STA_INS
)
{
*
leap59
=
0
;
*
leap61
=
1
;
}
else
if
(
t
.
status
==
STA_DEL
)
{
}
else
if
(
(
t
.
status
&
STA_DEL
)
==
STA_DEL
)
{
*
leap59
=
1
;
*
leap61
=
0
;
}
else
{
...
...
@@ -89,6 +89,7 @@ static int unix_time_get_utc_offset(struct pp_instance *ppi, int *offset, int *l
static
int
unix_time_set_utc_offset
(
struct
pp_instance
*
ppi
,
int
offset
,
int
leap59
,
int
leap61
)
{
struct
timex
t
;
int
ret
;
/* get the current flags first */
memset
(
&
t
,
0
,
sizeof
(
t
));
...
...
@@ -104,11 +105,11 @@ static int unix_time_set_utc_offset(struct pp_instance *ppi, int offset, int lea
t
.
status
|=
STA_INS
;
t
.
status
&=
~
STA_DEL
;
}
else
{
t
.
modes
=
MOD_STA
T
US
;
t
.
modes
=
MOD_STAUS
;
t
.
status
&=
~
STA_INS
;
t
.
status
&=
~
STA_DEL
;
}
else
}
else
pp_diag
(
ppi
,
time
,
1
,
"get UTC offset and flags failed"
);
t
.
modes
|=
MOD_TAI
;
...
...
@@ -175,6 +176,8 @@ static int unix_time_init_servo(struct pp_instance *ppi)
/* get the current flags first */
memset
(
&
t
,
0
,
sizeof
(
t
));
ret
=
adjtimex
(
&
t
);
if
(
ret
<
0
)
pp_diag
(
ppi
,
time
,
1
,
"get current UTC offset and flags failed"
);
/* We must set MOD_PLL and recover the current frequency value */
t
.
modes
=
MOD_STATUS
;
...
...
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