Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BIRD Internet Routing Daemon
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
b594ad23
Commit
b594ad23
authored
Jun 01, 2000
by
Martin Mareš
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tm_format_reltime() works with both past and future timestamps.
parent
c23f40b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
sysdep/unix/io.c
sysdep/unix/io.c
+2
-4
No files found.
sysdep/unix/io.c
View file @
b594ad23
...
...
@@ -305,13 +305,11 @@ void
tm_format_reltime
(
char
*
x
,
bird_clock_t
t
)
{
struct
tm
*
tm
;
bird_clock_t
delta
=
now
-
t
;
bird_clock_t
delta
=
(
t
<
now
)
?
(
now
-
t
)
:
(
t
-
now
)
;
static
char
*
month_names
[
12
]
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
tm
=
localtime
(
&
t
);
if
(
delta
<
0
)
strcpy
(
x
,
"?fut?"
);
else
if
(
delta
<
20
*
3600
)
if
(
delta
<
20
*
3600
)
bsprintf
(
x
,
"%02d:%02d"
,
tm
->
tm_hour
,
tm
->
tm_min
);
else
if
(
delta
<
360
*
86400
)
bsprintf
(
x
,
"%s%02d"
,
month_names
[
tm
->
tm_mon
],
tm
->
tm_mday
);
...
...
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