Refactor ust-app create session
authorDavid Goulet <dgoulet@efficios.com>
Wed, 16 Jan 2013 20:19:35 +0000 (15:19 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 16 Jan 2013 20:35:29 +0000 (15:35 -0500)
commit3d8ca23bff823eab12128dfbb494369c15f31403
tree2324148b326326421072dcb4b54ecdba11835571
parent3a24c121f0901ebeb6f91c7424da21f11b05d6e2
Refactor ust-app create session

This function was basically a mess for returned values. A valid pointer
that could be a created or already existing session, NULL on error or -1
on disconnect error...

Now, it returns 0 on success or a negative errno code. It populates the
ust app session pointer parameter given by the caller and sets to 1, if
available, the is_created parameter if we did in fact create a new
session.

The motivation behind that was to be able to know if the session was
created or not so we could do a cleanup aftwerwards if any error on the
code path requires wipping the session object. This patch uses that for
the case of a create channel failure just after the session creation. It
now wipes the session if it was created.

Furthermore, this has been error prone in the past by forgetting to
handle the -1 error value being in a pointer variable.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c
This page took 0.02515 seconds and 4 git commands to generate.