git://git.onelab.eu
/
iptables.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2d8bb45
)
Fixed bugs that Daniel pointed out.
author
Sapan Bhatia
<sapanb@cs.princeton.edu>
Fri, 16 Nov 2007 01:04:08 +0000
(
01:04
+0000)
committer
Sapan Bhatia
<sapanb@cs.princeton.edu>
Fri, 16 Nov 2007 01:04:08 +0000
(
01:04
+0000)
src/fprobe-ulog.c
patch
|
blob
|
history
diff --git
a/src/fprobe-ulog.c
b/src/fprobe-ulog.c
index
c5be35f
..
26eac1f
100644
(file)
--- a/
src/fprobe-ulog.c
+++ b/
src/fprobe-ulog.c
@@
-379,12
+379,17
@@
inline void copy_flow(struct Flow *src, struct Flow *dst)
}
void get_cur_epoch() {
- int fd
, len
;
+ int fd;
fd = open("/tmp/fprobe_last_epoch",O_RDONLY);
if (fd != -1) {
char snum[7];
- read(fd, snum, 7);
- sscanf(snum,"%d",&cur_epoch);
+ ssize_t len;
+ len = read(fd, snum, sizeof(snum)-1);
+ if (len != -1) {
+ snum[len]='\0';
+ sscanf(snum,"%d",&cur_epoch);
+ close(fd);
+ }
}
return;
}