Fix: Lib lttng-ctl on error returns lttng code
authorDavid Goulet <dgoulet@efficios.com>
Mon, 24 Sep 2012 19:35:18 +0000 (15:35 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 24 Sep 2012 20:22:17 +0000 (16:22 -0400)
commit2f70b271351fe2b7befc4e327503f7c13a57dcd5
tree2ddf281b8e399d1d29242b054fc560f5983d33a2
parentff7ef7b8297ae2e3aa6451a0045d657d91aec7be
Fix: Lib lttng-ctl on error returns lttng code

The library was returning negative value that were NOT a lttng error
code documented in lttng-error.h. This was problematic because the
lttng_strerror() could not recognized the returned code and thus the
caller was clueless about the error.

This patch makes sure every lttng-ctl calls return either the correct
documented positive value or a negative lttng error code on error that
can be directly translate by lttng_strerror() which takes a negative
lttng code.

Small fix: enable event command, when hitting a loglevel error now
returns a lttng error code and does not print the help anymore.

Fixes #337

Signed-off-by: David Goulet <dgoulet@efficios.com>
include/lttng/lttng-error.h
src/bin/lttng/commands/enable_events.c
src/common/error.c
src/lib/lttng-ctl/lttng-ctl.c
This page took 0.027635 seconds and 5 git commands to generate.