diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-09-26 21:19:29 +0200 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-09-26 21:19:29 +0200 |
commit | ca925e8b5231d96f93b1b8513b9348fdec8c1071 (patch) | |
tree | d1c88513edd431f014c675bf8d5dd83d15a2f917 | |
parent | b41822a1c7031c417287e646a8bb23c1b4a1ac4d (diff) | |
download | librb-ca925e8b5231d96f93b1b8513b9348fdec8c1071.tar.gz librb-ca925e8b5231d96f93b1b8513b9348fdec8c1071.tar.bz2 librb-ca925e8b5231d96f93b1b8513b9348fdec8c1071.zip |
add: missing ECANCELED tests for rb_write() case
-rw-r--r-- | tests.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -164,14 +164,9 @@ static void *multi_producer(void *arg) { if (rb_posix_write(rb, fd, 1) == -1) { - if (errno == ECANCELED) - { - /* - * stop, no more, rb is not valid any more - */ - - return NULL; - } + int *e = malloc(sizeof(int)); + *e = errno; + return e; } } } @@ -534,7 +529,10 @@ static void multi_file_consumer_producer(void) pthread_join(pipet, NULL); for (i = 0; i != t_num_producers; ++i) { - pthread_join(prod[i], NULL); + int *r; + pthread_join(prod[i], (void **)&r); + mt_fail(*r == ECANCELED); + free(r); } close(prod_data.fd); } |