]> git.proxmox.com Git - mirror_lxcfs.git/commit
uptime: fix a problem with subsequent reads.
authorBernhard Miklautz <bernhard.miklautz@shacknet.at>
Thu, 3 Aug 2017 11:37:37 +0000 (13:37 +0200)
committerBernhard Miklautz <bernhard.miklautz@shacknet.at>
Thu, 3 Aug 2017 11:54:11 +0000 (13:54 +0200)
commitbbdf646b5e0c3f300c50776a85d2f805fd3aef45
tree545e09f8891f075f1d57e7c35ec8c4fb7edbb3e1
parentbd045652906c1c87836b4ff46be10fed3ddab237
uptime: fix a problem with subsequent reads.

When doing subsequent reads of uptime on an open file handle
in the form:

read
lseek 0L, SEEK_SET
read

the second (and later) reads cause that the error
"failed to write to cache" was printed. This
happens for example with "top". top would print the error:

bad data in /proc/uptime

To fix this problem use the whole size of the buffer instead of the d->size
because this is set on the first read.

This behavior was introduced with commit 0ecddf023a4caf8e8d2fe7e9125d777a06c5ec12.

Signed-off-by: Bernhard Miklautz <bernhard.miklautz@shacknet.at>
bindings.c