Fix: handle EINTR return value for bt_posix_fallocate
[babeltrace.git] / formats / ctf / writer / event-fields.c
index 9eff2dca98b19e3cb8eaa995af7cf6be968038f9..c49bc3fa6dc1bca5b325b1be872480c9e68a1487 100644 (file)
@@ -1242,9 +1242,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.022653 seconds and 4 git commands to generate.