X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-comm.c;fp=liblttng-ust%2Flttng-ust-comm.c;h=2712a8d8abf51649bc00ab837b97a6cf35fc4e61;hb=355e3ac6aabfd7363aedd783bda99fb9c584e56f;hp=fbdee7d3af8ea0d8d122ab3e4b3bb8a251ccc9a0;hpb=4adaf46c3b518e077bdda3e573aa743aa2e516c9;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index fbdee7d3..2712a8d8 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -927,7 +927,12 @@ void cleanup_sock_info(struct sock_info *sock_info, int exiting) long page_size; page_size = sysconf(_SC_PAGE_SIZE); - if (page_size > 0) { + if (page_size <= 0) { + if (!page_size) { + errno = EINVAL; + } + PERROR("Error in sysconf(_SC_PAGE_SIZE)"); + } else { ret = munmap(sock_info->wait_shm_mmap, page_size); if (ret) { ERR("Error unmapping wait shm"); @@ -1109,7 +1114,11 @@ char *get_map_shm(struct sock_info *sock_info) char *wait_shm_mmap; page_size = sysconf(_SC_PAGE_SIZE); - if (page_size < 0) { + if (page_size <= 0) { + if (!page_size) { + errno = EINVAL; + } + PERROR("Error in sysconf(_SC_PAGE_SIZE)"); goto error; }