Changeset 2193905 for lib/data-struct/message_queue.c
- Timestamp:
- 11/29/18 10:12:59 (2 years ago)
- Branches:
- develop
- Children:
- fdf23b8
- Parents:
- d74ca03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/data-struct/message_queue.c
r0a474e3 r2193905 43 43 void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len) 44 44 { 45 /*assert(message_len);*/46 45 if (!message_len) { 47 46 fprintf(stderr, "Message length cannot be 0 in libtrace_message_queue_init()\n"); … … 73 72 { 74 73 int ret; 75 /*assert(mq->message_len);*/ 76 //if (!mq->message_len) { 77 // fprintf(stderr, "Message queue must be initialised with libtrace_message_queue_init()" 78 // "before inserting messages in libtrace_message_queue_put()\n"); 79 // /* Can we return -1 here as this could imply threads are waiting */ 80 // return -1; 81 //} 74 if (!mq->message_len) { 75 fprintf(stderr, "Message queue must be initialised with libtrace_message_queue_init()" 76 "before inserting messages in libtrace_message_queue_put()\n"); 77 return 0; 78 } 82 79 ASSERT_RET(write(mq->pipefd[1], message, mq->message_len), == (int) mq->message_len); 83 80 // Update after we've written
Note: See TracChangeset
for help on using the changeset viewer.