X-Git-Url: https://git.liburcu.org/?p=ust.git;a=blobdiff_plain;f=ust-consumerd%2Fust-consumerd.c;h=c96139455d24ecdbb54014f9f829b42819ef2f5f;hp=ce2ee40a339a96b05e880c7355af1a2e63a2f2f6;hb=5343b2860738c675311ce5949bdf9e31afc76fa4;hpb=fe566790e6be3f27f0befd85b715a3e84977bf6c diff --git a/ust-consumerd/ust-consumerd.c b/ust-consumerd/ust-consumerd.c index ce2ee40..c961394 100644 --- a/ust-consumerd/ust-consumerd.c +++ b/ust-consumerd/ust-consumerd.c @@ -210,7 +210,11 @@ int on_open_buffer(struct ustconsumer_callbacks *data, struct buffer_info *buf) trace_path, buf->pid, buf->pidunique, buf->name); return 1; } +again: result = fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 00600); + if (result == -1 && errno == EINTR) + goto again; + if(result == -1) { PERROR("open"); ERR("failed opening trace file %s", tmp); @@ -225,7 +229,12 @@ int on_open_buffer(struct ustconsumer_callbacks *data, struct buffer_info *buf) int on_close_buffer(struct ustconsumer_callbacks *data, struct buffer_info *buf) { struct buffer_info_local *buf_local = buf->user_data; - int result = close(buf_local->file_fd); + int result; + +again: + result = close(buf_local->file_fd); + if (result == -1 && errno == EINTR) + goto again; free(buf_local); if(result == -1) { PERROR("close");