summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorDima Kogan2010-08-14 11:15:47 +0200
committerKarel Zak2010-08-20 13:15:14 +0200
commit3a788d773b13078ce8c87247e7f5f556646203b3 (patch)
treeac33c8860b57f6862004c344787b30589b4a5d5d /sys-utils/lscpu.c
parentlosetup: do not distinguish between malloc and realloc (diff)
downloadkernel-qcow2-util-linux-3a788d773b13078ce8c87247e7f5f556646203b3.tar.gz
kernel-qcow2-util-linux-3a788d773b13078ce8c87247e7f5f556646203b3.tar.xz
kernel-qcow2-util-linux-3a788d773b13078ce8c87247e7f5f556646203b3.zip
tailf: fixed timing issue that could cause duplicate data output
The issue is that in roll_file() we fstat() to find the file size, then read() as much data as we can and then use the previously saved file size to mark our position. The bug occurs if we read past the file size reported by fstat() because more data has arrived while we were reading it. The attached patch uses the current file position as the location marker instead, with some extra logic to handle tailing truncated files. [kzak@redhat.com: - fix coding style] Signed-off-by: Dima Kogan <dkogan@cds.caltech.edu> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu.c')
0 files changed, 0 insertions, 0 deletions