int validate_buffers(int *enabled_buffers)
{
+ /* KMSG lacks some timestamps so we have trouble sorting
+ * it with core buffers, thus mixing them is not supported
+ * at the moment. Possibly in the future we could reduce
+ * the timestamp bloat and allow it.
+ *
+ * Ideally, this would only happen for modes that actually
+ * want to sort the buffers (so would be allowed for clearing
+ * buffers, for example). */
if (*enabled_buffers & (1 << LOG_ID_KMSG)
&& *enabled_buffers & ~(1 << LOG_ID_KMSG))
- return -EINVAL;
+ return -ENOTSUP;
if (!*enabled_buffers)
*enabled_buffers = default_buffers;
assert(fdis);
assert(conf);
- if (validate_buffers(&enabled_buffers) < 0)
- return -EINVAL;
+ int ret = validate_buffers(&enabled_buffers);
+ if (ret < 0)
+ return ret;
struct fd_info **fdi_ptrs = calloc(bit_count(enabled_buffers) + 1 /* NULL terminator */, sizeof *fdi_ptrs);
if (!fdi_ptrs)
__attribute__ ((cleanup(list_clear_free_contents))) list_head used_paths = NULL;
int fdi_cnt = 0;
- int ret = 0;
for (int i = 0; i < LOG_ID_MAX; ++i) {
if (!bit_test(enabled_buffers, i))
continue;
assert(buf == (1 << LOG_ID_MAIN));
buf |= 1 << LOG_ID_KMSG;
- assert(validate_buffers(&buf) == -EINVAL);
+ assert(validate_buffers(&buf) == -ENOTSUP);
sort_vector_free(&sv);
}