Commit 432b47f3 authored by Federico G. Schwindt's avatar Federico G. Schwindt

Workaround multiple cleanup handlers support

Apparently this is missing in sunos+gcc 4.7.
While here tight things up a bit.
parent ba28f786
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment