Ignore:
Timestamp:
11/29/18 10:12:59 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
fdf23b8
Parents:
d74ca03
Message:

Apply changes required for pull request #81

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/data-struct/message_queue.c

    r0a474e3 r2193905  
    4343void libtrace_message_queue_init(libtrace_message_queue_t *mq, size_t message_len)
    4444{
    45         /*assert(message_len);*/
    4645        if (!message_len) {
    4746                fprintf(stderr, "Message length cannot be 0 in libtrace_message_queue_init()\n");
     
    7372{
    7473        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        }
    8279        ASSERT_RET(write(mq->pipefd[1], message, mq->message_len), == (int) mq->message_len);
    8380        // Update after we've written
Note: See TracChangeset for help on using the changeset viewer.