#include <babeltrace/ctf-writer/event-fields-internal.h>
#include <babeltrace/ctf-writer/event-types-internal.h>
#include <babeltrace/compiler.h>
+#include <babeltrace/compat/fcntl.h>
#define PACKET_LEN_INCREMENT (getpagesize() * 8 * CHAR_BIT)
tag_enum_integer = container_of(tag_enum, struct bt_ctf_field_integer,
parent);
- if (!bt_ctf_field_validate(variant->tag)) {
+ if (bt_ctf_field_validate(tag_field) < 0) {
goto end;
}
}
size = integer_type->declaration.len;
- min_value = -((int64_t)1 << (size - 1));
- max_value = ((int64_t)1 << (size - 1)) - 1;
+ min_value = -(1ULL << (size - 1));
+ max_value = (1ULL << (size - 1)) - 1;
if (value < min_value || value > max_value) {
ret = -1;
goto end;
}
pos->packet_size += PACKET_LEN_INCREMENT;
- ret = posix_fallocate(pos->fd, pos->mmap_offset,
- pos->packet_size / CHAR_BIT);
+ do {
+ ret = bt_posix_fallocate(pos->fd, pos->mmap_offset,
+ pos->packet_size / CHAR_BIT);
+ } while (ret == EINTR);
if (ret) {
+ errno = EINTR;
+ ret = -1;
goto end;
}