ir: allow to set variant FT's tag FT even when frozen
[babeltrace.git] / formats / ctf / ir / event-fields.c
index aa7475d0952722512636af701237ba68a361a81c..65c9aee863a7511ec4629fb9c9aaecfd1b8d6285 100644 (file)
@@ -234,14 +234,22 @@ struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
 {
        struct bt_ctf_field *field = NULL;
        enum ctf_type_id type_id;
+       int ret;
 
        if (!type) {
                goto error;
        }
 
        type_id = bt_ctf_field_type_get_type_id(type);
-       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES ||
-               bt_ctf_field_type_validate(type)) {
+       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES) {
+               goto error;
+       }
+
+       /* Field class MUST be valid */
+       ret = bt_ctf_field_type_validate(type);
+
+       if (ret) {
+               /* Invalid */
                goto error;
        }
 
@@ -2171,9 +2179,13 @@ int increase_packet_size(struct ctf_stream_pos *pos)
        }
 
        pos->packet_size += PACKET_LEN_INCREMENT;
-       ret = bt_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;
        }
 
This page took 0.023548 seconds and 4 git commands to generate.