X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-context-perf-counters.c;h=99691c067f23a421ceee6f5f07f883b68b543e03;hb=6c2125aff1c8d8217072931ee6223be80112dcb2;hp=d6bd41cc9e20a170dc73f5d76d473781cdd1e737;hpb=3e4e9902d1564c56a1193b133c6dffded0dc29db;p=lttng-ust.git diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index d6bd41cc..99691c06 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -134,7 +134,7 @@ static struct perf_event_mmap_page *setup_perf(struct perf_event_attr *attr) { void *perf_addr; - int fd; + int fd, ret; fd = sys_perf_event_open(attr, 0, -1, -1, 0); if (fd < 0) @@ -144,7 +144,10 @@ struct perf_event_mmap_page *setup_perf(struct perf_event_attr *attr) PROT_READ, MAP_SHARED, fd, 0); if (perf_addr == MAP_FAILED) return NULL; - close(fd); + ret = close(fd); + if (ret) { + perror("Error closing LTTng-UST perf memory mapping FD"); + } return perf_addr; }