goto error;
}
+ if (pos->last_offset == pos->offset) {
+ fprintf(stderr, "[error] Invalid 0 byte event encountered.\n");
+ return -EINVAL;
+ }
+
return 0;
error:
switch (whence) {
case SEEK_CUR:
/* The writer will add padding */
- pos->mmap_offset += WRITE_PACKET_LEN / CHAR_BIT;
+ pos->mmap_offset += pos->packet_size / CHAR_BIT;
break;
case SEEK_SET:
assert(index == 0); /* only seek supported for now */