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)
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>

No differences found
This page took 0.029293 seconds and 5 git commands to generate.