aboutsummaryrefslogtreecommitdiff
path: root/lib/buffer.c
AgeCommit message (Collapse)Author
2020-11-11buffer.c: correct return value when buf is NULLZhiqiang Liu
In commit d614415a ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func"), if fuse_bufvec_current func returns NULL, it returns 1 directly. Actually, we should return 0 when buf is NULL. Fixes: d614415a ("buffer.c: check whether buf is NULL in fuse_bufvec_advance func") Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Li <lihaotian9@huawei.com>
2020-11-06buffer.c: check whether buf is NULL in fuse_bufvec_advance funcZhiqiang Liu
In fuse_bufvec_advance func, calling fuse_bufvec_current func may return NULL, so we should check whether buf is NULL before using it. Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com> Signed-off-by: Haotian Liu <lihaotian9@huawei.com>
2019-06-06Avoid pointer arithmetic with `void *`Michael Forney
The pointer operand to the binary `+` operator must be to a complete object type. Since we are working with byte sizes, use `char *` instead.
2016-10-02Extended per-file comments.Nikolaus Rath
This should make more clear what file contains code for what purpose.
2012-08-24Fix missing config.h in buffer.cMiklos Szeredi
Due to an oversight, splice will never actually be used for i/o. Someone forgot to #include "config.h" in lib/buffer.c (in fact almost no files include that header). As a result, even though configure detects splice support and puts HAVE_SPLICE in config.h, buffer.c is always compiled as if there is no splice support. Also add #include "config.h" to fuse.c and fuse_lowlevel.c. These currently include it indirectly through fuse_misc.h, but we don't want to depend on that. Reported by Matthew Gabeler-Lee
2011-05-27Check if splice/vmsplice are supportedMiklos Szeredi
2010-11-10fuse_buf_copy: check if buffers are the sameMiklos Szeredi
When copying fuse buffers, check if the source and destination are the same and omit the copy as appropriate. Also check if the source and destination memory regions overlap and use memmove in that case.
2010-11-08Fix fuse_buf_copy() if already at the end of the buffersMiklos Szeredi
2010-07-12libfuse: add buffer interfaceMiklos Szeredi
Add a generic buffer interface for use with I/O. Buffer vectors are supplied and each buffer in the vector may be a memory pointer or a file descriptor. The fuse_reply_fd() interface is converted to using buffers.