repo.or.cz
/
tomato.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Changes for kernel and Busybox
[tomato.git]
/
release
/
src
/
router
/
bpalogin
/
get_time.c
blob
62cbbbc9d4fba37b820db9eb2f8d8ca90cc0c9c3
1
#include <stdio.h>
2
#include <sys/sysinfo.h>
3
#include <time.h>
4
5
#define USE_UPTIME 1
6
7
// When system time change, the lease table will error, so we use system uptime
8
time_t
// long int
9
get_time
(
time_t
*
t
){
10
#ifdef USE_UPTIME
11
struct
sysinfo info
;
12
13
sysinfo
(&
info
);
14
15
return
info
.
uptime
;
16
#else
17
return
time
(
0
);
18
#endif
19
}
20