aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-09-26 21:19:29 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-09-26 21:19:29 +0200
commitca925e8b5231d96f93b1b8513b9348fdec8c1071 (patch)
treed1c88513edd431f014c675bf8d5dd83d15a2f917
parentb41822a1c7031c417287e646a8bb23c1b4a1ac4d (diff)
downloadlibrb-ca925e8b5231d96f93b1b8513b9348fdec8c1071.tar.gz
librb-ca925e8b5231d96f93b1b8513b9348fdec8c1071.tar.bz2
librb-ca925e8b5231d96f93b1b8513b9348fdec8c1071.zip
add: missing ECANCELED tests for rb_write() case
-rw-r--r--tests.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests.c b/tests.c
index df1e30f..b1d9a0e 100644
--- a/tests.c
+++ b/tests.c
@@ -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);
}