Project

General

Profile

Actions

Bug #901

open

Some liblttng-ctl don't return LTTNG_OK on success

Added by Jérémie Galarneau over 9 years ago. Updated over 1 year ago.

Status:
In Progress
Priority:
Normal
Target version:
-
Start date:
08/05/2015
Due date:
% Done:

0%

Estimated time:

Description

It appears that some liblttng-ctl functions, such as lttng_create_session_snapshot() have conflicting return code conventions.

In this specific case, the header under lttng/session.h asserts that the function will

/*
 [...]
 * Return 0 on success else a negative LTTng error code.
 */

while the header in lttng-ctl.c affirms that it

/*
 [...]
 * Returns LTTNG_OK on success or a negative error code.
 */

and the function actually returns

ret = lttng_ctl_ask_sessiond_varlen(&lsm, uris, ...

which, itself will

/*
 [...]
 Return size of data (only payload, not header) or a negative error code.
 */

This pattern is used in multiple places which breaks code which checks for "ret == LTTNG_OK" instead of "ret < 0".

Actions

Also available in: Atom PDF