repo.or.cz
/
tomato
/
davidwu.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Correct PPTP server firewall rules chain.
[tomato/davidwu.git]
/
release
/
src
/
router
/
wanuptime
/
wanuptime.c
blob
ace7feeeb138ba6881a84cdb91302c9f14c1e67c
1
#include <stdio.h>
2
#include <sys/sysinfo.h>
3
#include <time.h>
4
5
int
main
(
int
argc
,
char
**
argv
)
6
{
7
struct
sysinfo si
;
8
time_t
uptime
;
9
10
sysinfo
(&
si
);
11
if
(
check_wanup
() && (
f_read
(
"/var/lib/misc/wantime"
, &
uptime
,
sizeof
(
time_t
)) ==
sizeof
(
uptime
))) {
12
printf
(
"%ld
\n
"
,
si
.
uptime
-
uptime
);
13
}
14
else
15
printf
(
"0
\n
"
);
16
return
0
;
17
}