aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcoopgamma.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-06 16:20:33 +0200
committerMattias Andrée <maandree@kth.se>2016-08-06 16:20:33 +0200
commit72874f86448dd0f2031a09e17b70031408e69366 (patch)
treee16d703325fd3ecd3a82e8ef1a5bd5dd3074f972 /src/libcoopgamma.c
parentAppearently it is not easy to interrupt recv(3) (diff)
downloadlibcoopgamma-72874f86448dd0f2031a09e17b70031408e69366.tar.gz
libcoopgamma-72874f86448dd0f2031a09e17b70031408e69366.tar.bz2
libcoopgamma-72874f86448dd0f2031a09e17b70031408e69366.tar.xz
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/libcoopgamma.c')
-rw-r--r--src/libcoopgamma.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c
index 2d1ca37..269b2c8 100644
--- a/src/libcoopgamma.c
+++ b/src/libcoopgamma.c
@@ -2021,7 +2021,7 @@ char** libcoopgamma_get_crtcs_recv(libcoopgamma_context_t* restrict ctx,
char** libcoopgamma_get_crtcs_sync(libcoopgamma_context_t* restrict ctx)
{
SYNC_CALL(libcoopgamma_get_crtcs_send(ctx, &async),
- libcoopgamma_get_crtcs_recv(ctx, &async), NULL);
+ libcoopgamma_get_crtcs_recv(ctx, &async), (copy_errno(ctx), NULL));
}
@@ -2229,7 +2229,7 @@ int libcoopgamma_get_gamma_info_sync(const char* restrict ctrc, libcoopgamma_crt
libcoopgamma_context_t* restrict ctx)
{
SYNC_CALL(libcoopgamma_get_gamma_info_send(ctrc, ctx, &async),
- libcoopgamma_get_gamma_info_recv(info, ctx, &async), -1);
+ libcoopgamma_get_gamma_info_recv(info, ctx, &async), (copy_errno(ctx), -1));
}
@@ -2357,7 +2357,8 @@ int libcoopgamma_get_gamma_recv(libcoopgamma_filter_table_t* restrict table,
if (bad || (have_depth != 1) || (have_red_size != 1) || (have_green_size != 1) ||
(have_blue_size != 1) || (async->coalesce ? (have_tables > 1) : (have_tables == 0)) ||
- (payload == NULL))
+ (((payload == NULL) || (n == 0)) && (async->coalesce || (table->filter_count > 0))) ||
+ ((n > 0) && (table->filter_count == 0)))
goto bad;
switch (table->depth)
@@ -2387,6 +2388,8 @@ int libcoopgamma_get_gamma_recv(libcoopgamma_filter_table_t* restrict table,
goto fail;
memcpy(table->filters->ramps.u8.red, payload, clutsize);
}
+ else if (table->filter_count == 0)
+ table->filters = NULL;
else
{
size_t off = 0, len;
@@ -2448,7 +2451,7 @@ int libcoopgamma_get_gamma_sync(const libcoopgamma_filter_query_t* restrict quer
libcoopgamma_context_t* restrict ctx)
{
SYNC_CALL(libcoopgamma_get_gamma_send(query, ctx, &async),
- libcoopgamma_get_gamma_recv(table, ctx, &async), -1);
+ libcoopgamma_get_gamma_recv(table, ctx, &async), (copy_errno(ctx), -1));
}
@@ -2588,7 +2591,7 @@ int libcoopgamma_set_gamma_sync(const libcoopgamma_filter_t* restrict filter,
libcoopgamma_context_t* restrict ctx)
{
SYNC_CALL(libcoopgamma_set_gamma_send(filter, ctx, &async),
- libcoopgamma_set_gamma_recv(ctx, &async), -1);
+ libcoopgamma_set_gamma_recv(ctx, &async), (copy_errno(ctx), -1));
}