[master] 432b47f3f Workaround multiple cleanup handlers support
Federico G. Schwindt
fgsch at lodoss.net
Wed Jan 1 14:02:08 UTC 2020
commit 432b47f3f2f9e15a24251a2eeb2002c4e7534fcb
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Wed Jan 1 13:58:34 2020 +0000
Workaround multiple cleanup handlers support
Apparently this is missing in sunos+gcc 4.7.
While here tight things up a bit.
diff --git a/bin/varnishtest/vtc_client.c b/bin/varnishtest/vtc_client.c
index 7f62e8dbd..639e80a6d 100644
--- a/bin/varnishtest/vtc_client.c
+++ b/bin/varnishtest/vtc_client.c
@@ -205,8 +205,6 @@ client_connect(struct vtclog *vl, struct client *c)
* Client thread
*/
-typedef void (*cleanup_f)(void *);
-
static void *
client_thread(void *priv)
{
@@ -224,7 +222,9 @@ client_thread(void *priv)
vsb = macro_expand(vl, c->connect);
AN(vsb);
- pthread_cleanup_push((cleanup_f)VSB_delete, vsb);
+#if !defined(__sun)
+ pthread_cleanup_push((void (*)(void *))VSB_delete, vsb);
+#endif
c->addr = VSB_data(vsb);
if (c->repeat == 0)
@@ -246,7 +246,9 @@ client_thread(void *priv)
VTCP_close(&fd);
}
vtc_log(vl, 2, "Ending");
+#if !defined(__sun)
pthread_cleanup_pop(0);
+#endif
pthread_cleanup_pop(0);
VSB_delete(vsb);
vtc_logclose(vl);
More information about the varnish-commit
mailing list