Fix: lttng-tracepoint module notifier should return NOTIFY_OK
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Jun 2019 13:43:45 +0000 (09:43 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Jun 2019 14:02:18 +0000 (10:02 -0400)
commit37ddebc43f04886b44ae624791466e9a3942b9b4
tree694c35ece75ecf48d2e6d91f7634e194d4ff6fe2
parent624aca5d7507fbd11ea4a1a474c3aa1031bd9a31
Fix: lttng-tracepoint module notifier should return NOTIFY_OK

Module notifiers should return NOTIFY_OK on success rather than the
value 0. The return value 0 does not seem to have any ill side-effects
in the notifier chain caller, but it is preferable to respect the API
requirements in case this changes in the future.

Notifiers can encapsulate a negative errno value with
notifier_from_errno(), but this is not needed by the LTTng tracepoint
notifier.

The approach taken in this notifier is to just print a console warning
on error, because tracing failure should not prevent loading a module.
So we definitely do not want to stop notifier iteration. Returning
an error without stopping iteration is not really that useful, because
only the return value of the last callback is returned to notifier chain
caller.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-tracepoint.c
This page took 0.025232 seconds and 4 git commands to generate.