"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lxc/ringbuf.c" between
lxc-4.0.9.tar.gz and lxc-4.0.10.tar.gz

About: LXC are userspace tools for the Linux kernel containers that let users easily create and manage system or application containers.

ringbuf.c  (lxc-4.0.9):ringbuf.c  (lxc-4.0.10)
skipping to change at line 98 skipping to change at line 98
* ringbuffer. * ringbuffer.
* - The write method will always succeed i.e. it will always advance the r_off * - The write method will always succeed i.e. it will always advance the r_off
* if it detects that there's not enough space available to write the * if it detects that there's not enough space available to write the
* message. * message.
*/ */
int lxc_ringbuf_write(struct lxc_ringbuf *buf, const char *msg, size_t len) int lxc_ringbuf_write(struct lxc_ringbuf *buf, const char *msg, size_t len)
{ {
char *w_addr; char *w_addr;
uint64_t free; uint64_t free;
/* sanity check: a write should never exceed the ringbuffer's total size */ /* consistency check: a write should never exceed the ringbuffer's total size */
if (len > buf->size) if (len > buf->size)
return -EFBIG; return -EFBIG;
free = lxc_ringbuf_free(buf); free = lxc_ringbuf_free(buf);
/* not enough space left so advance read address */ /* not enough space left so advance read address */
if (len > free) if (len > free)
lxc_ringbuf_move_read_addr(buf, len); lxc_ringbuf_move_read_addr(buf, len);
w_addr = lxc_ringbuf_get_write_addr(buf); w_addr = lxc_ringbuf_get_write_addr(buf);
memcpy(w_addr, msg, len); memcpy(w_addr, msg, len);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)