- /* get buffer pipe fd */
- memset(&header, 0, sizeof(header));
- if (asprintf(&send_msg, "get_buffer_fd %s", buf->name) < 0) {
- ERR("connect_buffer : asprintf failed (get_buffer_fd %s)",
- buf->name);
- return NULL;
- }
- header.size = strlen(send_msg) + 1;
- result = ustcomm_send(buf->app_sock, &header, send_msg);
- free(send_msg);
- if (result <= 0) {
- ERR("ustcomm_send failed.");
- return NULL;
- }
- result = ustcomm_recv_fd(buf->app_sock, &header, NULL, &buf->pipe_fd);
- if (result <= 0) {
- ERR("ustcomm_recv_fd failed");
- return NULL;
- } else {
- struct stat temp;
- fstat(buf->pipe_fd, &temp);
- if (!S_ISFIFO(temp.st_mode)) {
- ERR("Didn't receive a fifo from the app");
- return NULL;
- }
+ /* Notify the application that we have mapped the buffer */
+ result = notify_buffer_mapped(buf->app_sock, buf);
+ if (result < 0) {
+ goto shmdt_bufstruct_mem;