- writeleft = sizeof(sendret);
- index = 0;
- do {
- do {
- writelen = write(data->retval_pipe, &sendret.c[index],
- writeleft);
- } while (writelen < 0 && errno == EINTR);
- if (writelen < 0) {
- PERROR("write");
- return EXIT_FAILURE;
- }
- writeleft -= writelen;
- index += writelen;
- } while (writeleft > 0);
- return EXIT_SUCCESS;
+ writelen = lttng_write(data->retval_pipe, &sendret, sizeof(sendret));
+ if (writelen < sizeof(sendret)) {
+ PERROR("lttng_write error");
+ return EXIT_FAILURE;
+ } else {
+ return EXIT_SUCCESS;
+ }