Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
612c8bc6
Commit
612c8bc6
authored
4 years ago
by
Jean-Claude BAU
Browse files
Options
Downloads
Patches
Plain Diff
SNMP: Fix issue on wrsLeapSecSourceStatusDetails field
This field is set now to NA if the local leap second file is used
parent
866dc42d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
userspace/snmpd/wrsCurrentTimeGroup.c
+23
-23
23 additions, 23 deletions
userspace/snmpd/wrsCurrentTimeGroup.c
with
23 additions
and
23 deletions
userspace/snmpd/wrsCurrentTimeGroup.c
+
23
−
23
View file @
612c8bc6
...
...
@@ -386,33 +386,33 @@ static void get_wrsLeapSecondSourceStatusDetails(void){
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: failed to "
"open "
LEAPSEC_SOURCE_URL
"
\n
"
,
slog_obj_name
);
}
}
if
(
srcUrl
==
NULL
)
srcUrl
=
""
;
strcpy
(
wrsCurrentTime_s
.
wrsLeapSecSourceUrl
,
srcUrl
);
// get the leap second source status
slog_obj_name
=
wrsLeapSecSourceStatusDetails_str
;
if
((
f
=
fopen
(
LEAPSEC_SOURCE_STATUS
,
"r"
))
!=
NULL
)
{
// get the leap second source status
slog_obj_name
=
wrsLeapSecSourceStatusDetails_str
;
if
((
f
=
fopen
(
LEAPSEC_SOURCE_STATUS
,
"r"
))
!=
NULL
)
{
/* readline without newline */
if
(
fscanf
(
f
,
LINE_READ_LEN
(
sizeof
(
buff
)
-
1
),
buff
)
==
1
)
check_status
=
getStatusFromMapping
(
mapping_leap_sec_src_status
,
buff
);
else
buff
[
0
]
=
0
;
fclose
(
f
);
if
(
check_status
==
0
)
{
check_status
=
WRS_LEAP_SEC_SRC_STATUS_DETAILS_UNKNOWN
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: invalid status (%s)
\n
"
,
slog_obj_name
,
buff
);
/* readline without newline */
if
(
fscanf
(
f
,
LINE_READ_LEN
(
sizeof
(
buff
)
-
1
),
buff
)
==
1
)
check_status
=
getStatusFromMapping
(
mapping_leap_sec_src_status
,
buff
);
else
buff
[
0
]
=
0
;
fclose
(
f
);
if
(
check_status
==
0
)
{
check_status
=
WRS_LEAP_SEC_SRC_STATUS_DETAILS_UNKNOWN
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: invalid status (%s)
\n
"
,
slog_obj_name
,
buff
);
}
}
else
{
/* File not found, probably something else caused
* a problem */
check_status
=
WRS_LEAP_SEC_SRC_STATUS_DETAILS_IO_ERROR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: failed to "
"open "
LEAPSEC_SOURCE_STATUS
"
\n
"
,
slog_obj_name
);
}
}
else
{
/* File not found, probably something else caused
* a problem */
check_status
=
WRS_LEAP_SEC_SRC_STATUS_DETAILS_IO_ERROR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: failed to "
"open "
LEAPSEC_SOURCE_STATUS
"
\n
"
,
slog_obj_name
);
}
if
(
srcUrl
==
NULL
)
srcUrl
=
""
;
strcpy
(
wrsCurrentTime_s
.
wrsLeapSecSourceUrl
,
srcUrl
);
wrsCurrentTime_s
.
wrsLeapSecSourceStatusDetails
=
check_status
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment